mysql设置远程访问

来源:互联网 发布:怎样加入网络直销 编辑:程序博客网 时间:2024/05/16 04:12

mysql设置远程访问

修改本机配置

注释掉在/etc/mysql/mysql.conf.d/mysqld.cnf里面的bind-address = 127.0.0.1

#By default we only accept connections from localhost#bind-address   = 127.0.0.1修改为bind-address   = 127.0.0.1

重启mysql服务 service mysql restart

添加用户

在mysql中添加远程访问用户
格式:grant 权限 on 数据库教程名.表名 to 用户@登录主机 identified by “用户密码”;

use mysql;Grant all on *.* to 'root'@'%' identified by 'root用户的密码' with grant option;flush privileges;

示例:

grant all privileges 'rushuo'.* to 'rushuo'@'%' identified by 'rushuo';flush privileges;
0 0
原创粉丝点击