mysql 任意ip访问

参考:https://easyengine.io/tutorials/mysql/remote-access

修改配置文件

vim /etc/mysql/my.cnf 或者 vim /etc/mysql/mysql.conf.d/mysqld.cnf


#bind-address = 127.0.0.1 #skip-networking

mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

检查权限
SELECT * from information_schema.user_privileges where grantee like "'root'%";

mysql> FLUSH PRIVILEGES;

Author: gangbo