当前位置:Gxlcms > 数据库问题 > MYSQL添加远程用户或允许远程访问

MYSQL添加远程用户或允许远程访问

时间:2021-07-01 10:21:17 帮助过:4人阅读

使用 root 用户登录: 

使用 grant 语句:

1、添加一个用户admin并授权通过本地机(localhost)访问,密码"something"

mysql>grant all privileges on *.* to admin@localhost identified by ‘something‘ with grant option;

2、添加一个用户admin并授权可从任何其它主机发起的访问(通配符%)

mysql>grant all privileges on *.* to admin@"%" identified by ‘something‘ with grant option;

3、刷新权限列表

mysql>flush privileges;

MYSQL添加远程用户或允许远程访问

标签:

人气教程排行