我搞砸了一些东西,我尝试在mysql工作台中创建本地服务器,但每次测试连接时都会显示一条错误消息。重置Mysql工作台root密码
我试图卸载MySQL的工作台,并重新安装,但用户“根”是未知的。它没有告诉任何有关在安装过程中的root密码,我尝试了各种密码,如空字符串,我的mac密码等,但没有一个工作,我尝试在stackoverflow中研究,但我仍然无法解决它。当您登录到MySQL的终端
我搞砸了一些东西,我尝试在mysql工作台中创建本地服务器,但每次测试连接时都会显示一条错误消息。重置Mysql工作台root密码
我试图卸载MySQL的工作台,并重新安装,但用户“根”是未知的。它没有告诉任何有关在安装过程中的root密码,我尝试了各种密码,如空字符串,我的mac密码等,但没有一个工作,我尝试在stackoverflow中研究,但我仍然无法解决它。当您登录到MySQL的终端
对于MAC用户/用户OSX
尝试该命令FLUSH PRIVILEGES
。 如果不工作,尝试同时在MySQL的终端
$ mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET password=PASSWORD("NEWPASSWORD") WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
更改了NEWPASSWORD
与任何密码,您希望下面的一组命令。应该全部设置!
Update:
从MySQL 5.7开始,密码字段已被重命名为authentication_string
。更改密码时,请使用以下查询更改密码。所有其他命令保持不变:
mysql> UPDATE user SET authentication_string=PASSWORD("NEWPASSWORD") WHERE User='root';
MySQL变更forgotted密码
0) shut down service mysql56
1) go to C:\ProgramData\MySQL\MySQL Server 5.6
(note that ProgramData is a hidden folder)
2) look for file my.ini, open it and add one line skip-grant-tables below [mysqld],
save [mysqld]
skip-grant-tables
3) start service mysql56
4) by right, you can access the database, and use the query below to update the password
update mysql.user set password=PASSWORD('NEW PASSWORD') where user='root';
5) shun down the service again, remove the line skip-grant-tables save it, and start the service again. try to use the password you set to login.
您必须更改MySQL的服务器端的某些内容,因为MySQL工作台只是一个客户端,并且与密码设置无关。 – Capsule
我该如何改变它?在mac中,在首选项下,它只是停止mysql服务器按钮? – KKKK
可能的重复http://stackoverflow.com/questions/17975120/access-denied-for-user-rootlocalhost-using-password-yes-no-privileges – mmuzahid