access denied for user 'root'@'localhost'

编辑mysql配置文件my.ini(在mysql的安装目录下,我的在D:Program FilesMySQLMySQL Server 5.0my.ini),在[mysqld]这个条目下加入 skip-grant-tables 保存退出后重启mysql

1.点击“开始”->“运行”(快捷键Win+R)。

2.停止:输入 net stop mysql

3.启动:输入 net start mysql  

原文地址:https://www.cnblogs.com/chenyishi/p/8643438.html