转载--MYSQL5.7:Access denied for user 'root'@'localhost' (using pa
程序员文章站
2022-05-23 18:14:00
1.打开MySQL目录下的my.ini文件,在文件的最后添加一行“skip-grant-tables”,保存并关闭文件; 2.重启MySQL服务; 3.通过cmd行进入MySQL的bin目录,输入“mysql -u root -p”(不输入密码),回车即可进入数据库; 4.执行“use mysql; ......
1.打开MySQL目录下的my.ini文件,在文件的最后添加一行“skip-grant-tables”,保存并关闭文件;
2.重启MySQL服务;
3.通过cmd行进入MySQL的bin目录,输入“mysql -u root -p”(不输入密码),回车即可进入数据库;
4.执行“use mysql;”,使用mysql数据库;
5.执行update mysql.user set authentication_string=password(‘123456’) where user=’root’ and Host = ‘localhost’;(修改root的密码);
6.打开MySQL目录下的my.ini文件,删除最后一行的“skip-grant-tables”,保存并关闭文件;
7.mysql> flush privileges;
8.mysql> quit;
9.在命令行中输入“mysql -u root -p 123456”,即可成功连接数据库。
版权声明:本文为博主原创文章,未经博主允许不得转载。 http://blog.csdn.net/wzhedward/article/details/71036689
上一篇: 构造函数,用来创建自定义对象的实例
下一篇: PHP类中的七种语法说明
推荐阅读
-
linux mysql忘记密码的多种解决或Access denied for user 'root'@'localhost'
-
ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)
-
连接本地数据库出现:1045 - Access denied for user 'root'@localhost'(using pass
-
ERROR 1045: Access denied for user: root@localhost (Using password: NO)
-
win10下MySQL 8.0登录Access denied for user‘root’@‘localhost’ (using password: YES)问题的解决方法
-
ERROR 1045 (28000): Access denied for user ''root''@''localhost'' (using passwor
-
Linux连接mysql报错:Access denied for user ‘root’@‘localhost’(using password: YES)的解决
-
MySQL密码正确却无法本地登录-1045 Access denied for user 'root'@'localhost' (using password:YES
-
Linux连接mysql报错:Access denied for user ‘root’@‘localhost’(using password: YES)的解决
-
ERROR 1045 (28000): Access denied for user ''root''@''localhost'' (using passwor