转载--MYSQL5.7:Access denied for user 'root'@'localhost' (using pa
程序员文章站
2022-11-28 16:30:09
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
推荐阅读
-
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
-
java访问数据库被拒绝,不能连接数据库ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
-
Warning: mysqli::__construct(): (HY000/1698): Access denied for user 'root'@'localhost'问题解决
-
Linux连接mysql报错:Access denied for user ‘root’@‘localhost’(using password: YES)的解决方法
-
ERROR 1045 (28000): Access denied for user ''root''@''localhost'' (using password: YES)实用解决方案