Linux下配置mysql远程访问

1 编辑mysql的配置文件 mysqld.cnf

root@iZwz99xkrnh5xye3zgi4btZ:~# vi /etc/mysql/mysql.conf.d/mysqld.cnf

 

2 把  bind-address = 127.0.0.1 注释掉

 

3 重启 root@iZwz99xkrnh5xye3zgi4btZ:~# sudo /etc/init.d/mysql restart

4 进入mysql,输入给root用户设置权限的命令行并回车

mysql> grant all privileges on *.* to root@"%" identified by "123321" with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;

 

posted on 2017-11-06 10:47  愚公学编程  阅读(355)  评论(0编辑  收藏  举报