100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > is this mysql server_mysql出现is not allowed to connect to this mysql server异常的解决办法

is this mysql server_mysql出现is not allowed to connect to this mysql server异常的解决办法

时间:2023-03-03 07:55:47

相关推荐

is this mysql server_mysql出现is not allowed to connect to this mysql server异常的解决办法

MySQL:无法远程登入MySQL Server

如何解决客户端与服务器端的连接(mysql) :xxx.xxx.xxx.xxx is not allowed to connect to this mysql serv

1、进入mysql,创建一个新用户xuys:

格式:grant 权限 on 数据库名.表名 用户@登录主机 identified by "用户密码";

grant select,update,insert,delete on *.* to xuys@192.168.88.234 identified by "xuys1234";

查看结果,执行:

use mysql;

select host,user,password from user;

可以看到在user表中已有刚才创建的xuys用户。host字段表示登录的主机,其值可以用IP,也可用主机名,

将host字段的值改为%就表示在任何客户端机器上能以xuys用户登录到mysql服务器,建议在开发时设为%。

update user set host = '%' where user = 'xuys';

2、./mysqladmin -uroot -p21century reload

./mysqladmin -uroot -p21century shutdown

3、./mysqld_safe --user-root &

记住:对授权表的任何修改都需要重新reload,或者重新启动MySql服务也行,即执行第3步。

如果经过以上3个步骤还是无法从客户端连接,请执行以下操作,在mysql数据库的db表中插入一条记录:

use mysql;

insert into db values('192.168.88.234','%','xuys','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

update db set host = '%' where user = 'xuys';

重复执行上面的第2、3步。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。