1、cmd打开终端,cd到MySQL安装路径bin目录下
2、输入mysql -h localhost -u root -p;出现输入密码,此时输入你在安装MYSQL软件设置的密码即可。
mysql -h localhost -u root -p;
1630226995599.jpg
4、输入use mysql;
use mysql;
1630227070802.jpg
5、输入select user, host from user;
select user, host from user;
1630227148504.jpg
6、使用update user set host='%' where host='localhost';语句更新即可
update user set host='%' where host='localhost';
1630227307176.jpg
7、输入use mysql;
use mysql;
1630227070802.jpg
8、输入select user, host from user;
select user, host from user;
1630227775421.jpg
如果还特么连不上试试这个:
输入:flush privileges;
flush privileges;
网友评论