1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > mysql不能通过ip地址访问权限_解决mysql中只能通过localhost访问不能通过ip访问的问题...

mysql不能通过ip地址访问权限_解决mysql中只能通过localhost访问不能通过ip访问的问题...

时间:2021-10-31 15:45:32

相关推荐

mysql不能通过ip地址访问权限_解决mysql中只能通过localhost访问不能通过ip访问的问题...

解决mysql中只能通过localhost访问不能通过ip访问的问题

原因是没开权限

select * from user where user='root';

grant all privileges on *.* to 'root'@'%' identified by '123456';

flush privileges;

1. 命令行进入mysql(假设root用户的密码也为root)

mysql –uroot –proot

2. 使用mysql数据库

use mysql;

3. 赋予权限

grant all privileges on *.* to ’root’@’%’ identified by ’root’;

其中*.*的意思是 所有库.所有表, 'root'@'%' identified by 'root'的前一个root是用户名,%是指所有访问ip,后一个root是指密码

这当然是一个糙汉子的赋权限方法,一个安静的女子应该将她写得优美而具体,比如:

grant all privileges on mdb.mtbl to ’beautiful’@’10.38.62.233’ identified by ’woman’;

4. 刷新权限(在不重启的情况下生效)

flush privileges;

听说实际实现方式是将user和privilige表里的东西扔进内存。

5. 重启mysql服务

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

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