如何删除MySQL root密码 [英] How to remove MySQL root password

查看:346
本文介绍了如何删除MySQL root密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想删除localhost用户root的密码.我怎样才能做到这一点?我错误地设置了root用户的密码.这就是phpmyadmin给出错误的原因:

I want to remove the password for user root in localhost. How can I do that? By mistake I have set the password of root user. That's why phpmyadmin is giving an error:

#1045 - Access denied for user 'root'@'localhost' (using password: NO)

推荐答案

您需要将root@localhost的密码设置为空白.有两种方法:

You need to set the password for root@localhost to be blank. There are two ways:

  1. MySQL SET PASSWORD 命令:

SET PASSWORD FOR root@localhost=PASSWORD('');

  • 使用命令行 mysqladmin 工具:

  • Using the command-line mysqladmin tool:

    mysqladmin -u root -pType_in_your_current_password_here password ''
    

  • 这篇关于如何删除MySQL root密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆