4

连接数据库提示Host 'localhost' is not allowed to connect to this MySQL server解决办法

在连接本地数据库出现Host 'localhost' is not allowed to connect to this MySQL server错误的解决办法:

1:关闭mysql服务

2:打开CMD窗口,进入mysql安装目录下的bin目录,输入:

mysqld --skip-grant-tables

然后回车

3:再打开一个CMD窗口,进入mysql安装目录下的bin目录,输入:

mysql -u root -p

回车

4:输入密码,回车(此密码是mysql的新密码)

5:即可正常连接mysql

posted @ 2021-09-22 22:26  山海自有归期  阅读(31)  评论(0编辑  收藏  举报