Error 1045(28000) Access Denied for user 'root'@'localhost'
1.修改my.ini配置文件,找到 [mysqld] 一行,在下面添加 skip-grant-tables 后保存,重启 mysql 服务。
2.然后执行 mysql -u root mysql
mysql>update user set password=password('newpassword') where user='root';
mysql>Flush privileges;
其中newpassword为root的新密码。
3.将刚才my.ini配置文件添加的那一行删掉,重新启动mysql即可
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30046312/viewspace-2142441/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30046312/viewspace-2142441/