win7系统之家当前位置:主页 > Win7教程 >

大神恢复win10系统连接Mysql提示Access denied for user 'root'@'localhost'的方案

时间:2019-10-31 07:33  来源: https://www.xggww.com    作者:Win7系统之家

  今天和大家分享一下win10系统连接Mysql提示Access denied for user 'root'@'localhost'问题的解决方法,在使用win10系统的过程中经常不知道如何去解决win10系统连接Mysql提示Access denied for user 'root'@'localhost'的问题,有什么好的办法去解决win10系统连接Mysql提示Access denied for user 'root'@'localhost'呢?小编教你只需要1、点击“开始”->“程序”->"运行",以管理员的身份运行; 2、在命令行中输入  C:/documents and settings/MMC>e:,e盘为Mysql服务所在的盘符;就可以了;下面就是我给大家分享关于win10系统连接Mysql提示Access denied for user 'root'@'localhost'的详细步骤::

win10系统连接Mysql提示Access denied for user

  1、点击“开始”->“程序”->"运行",以管理员的身份运行;

  2、在命令行中输入  C:/documents and settings/MMC>e:,e盘为Mysql服务所在的盘符;

  3、打开Mysql.bin目录,在命令行输入E:/>cd E:/mysql-5.5.49-win32/mysql-5.5.49-win32/bin;

  4、接着在命令行中输入 E:/sERVER/MysQL5122/bin>mysqld --defaults-file=" E:/mysql-5.5.49-win32/mysql-5.5.49-win32/ my.ini" --console --skip-grant-tables,只要出现下面信息,就说明 MysQL 已经起来了。

Version: '5.1.22-rc-community' socket: '' port: 3306 MysQL Community server 

  5、紧接着,不关闭此命令行窗口,重新打开一个命令行窗口,同样切到 “mysql/bin”目录下,然后执行下面的命令:

C:/documents and settings/MMC>e:

E:/>cd E:/mysql-5.5.49-win32/mysql-5.5.49-win32/bin

d:/>cd d:/sERVER/MysQL5122/bin E:/sERVER/MysQL5122/bin>mysql -u root mysql

出现welcome to the MysQL monitor. Commands end with ; or /g.Your MysQL connection id is 1server version: 5.1.22-rc-community MysQL Community server (GpL)Type 'help;' or '/h' for help. Type '/c' to clear the buffer.mysql>

  6、接着在命令行中输入粗体命令:

mysql>UpdATE user sET password=pAsswoRd('mynewpass') where UsER='root';

Query oK, 2 rows affected (0.05 sec) Rows matched: 2 Changed: 2 warnings: 0 mysql> FLUsH pRiViLEGEs; Query oK, 0 rows affected (0.02 sec) mysql> quit Bye

  7、好了到此步,可以关闭第一个 dos 窗口了。打开系统服务控制窗口(控制面板--管理工具--服务),启动 MysQL 服务。

  8、在剩下的第二个 dos 窗口中,用新的 RooT 密码连接 MysQL。

d:/sERVER/MysQL5122/bin>mysql -u root -p Enter password: ******** welcome to the MysQL monitor. Commands end with ; or /g. Your MysQL connection id is 2 server version: 5.1.22-rc-community MysQL Community server (GpL) Type 'help;' or '/h' for help. Type '/c' to clear the buffer.

  9、mysql> quit Bye 至此,系统恢复 RooT 用户管理权限完成。

  以上就是关于win10系统连接Mysql提示Access denied for user 'root'@'localhost'怎么办的全部内容,有碰到这样情况的用户们可以采取上面的方法来解决吧,希望更可以帮助到大家。

相关阅读
栏目专题推荐
win7系统下载推荐