很多人说第一次打开事没有密码,直接点过就可了。不过我这不行,同样问题的人应该还不少。
可以依次执行下面几步:
1.Start the MySQL server instance or daemon with the --skip-grant-tables option (security setting).
$ mysqld --skip-grant-tables
2.Execute these statements.
$ mysql -u root mysql
$mysql> UPDATE user SET Password=PASSWORD('my_password') where USER='root';
$mysql> FLUSH PRIVILEGES;
3.Finally, restart the instance/daemon without the --skip-grant-tables option.
$ /etc/init.d/mysql restart
然后就可以了 stackoverflow的链接:http://superuser.com/questions/603026/mysql-how-to-fix-access-denied-for-user-rootlocalhost
windows 上没好用 -。- 我再找找
可以依次执行下面几步:
1.Start the MySQL server instance or daemon with the --skip-grant-tables option (security setting).
$ mysqld --skip-grant-tables
2.Execute these statements.
$ mysql -u root mysql
$mysql> UPDATE user SET Password=PASSWORD('my_password') where USER='root';
$mysql> FLUSH PRIVILEGES;
3.Finally, restart the instance/daemon without the --skip-grant-tables option.
$ /etc/init.d/mysql restart
然后就可以了 stackoverflow的链接:http://superuser.com/questions/603026/mysql-how-to-fix-access-denied-for-user-rootlocalhost
windows 上没好用 -。- 我再找找