[MySQL]解决mysql数据库连接报错:is not allowed to connect to this mysql server

这是因为
mysql数据库只允许自身所在的本机器连接,不允许其他机器远程连接。

如果是root用户,执行sql语句:

use mysql;
 
select host from user where user='root';

如果是localhost ,那么就是只允许本地连接

update user set host = '%' where user ='root';
flush privileges;

这样就可以了

posted @ 2022-09-20 21:08  唯一客服系统开发笔记  阅读(471)  评论(0编辑  收藏  举报