开启 MySQL 远程访问权限
新增用户并授权
使用 root 用户执行:
CREATE USER 'your_username'@'%' IDENTIFIED BY 'your_password'; |
允许所有地址访问
注释掉 /etc/mysql/mysql.conf.d/mysqld.cnf (或类似文件)中的 bind-address = 127.0.0.1
。
重启 MySQL:
service mysql restart |
使用 root 用户执行:
CREATE USER 'your_username'@'%' IDENTIFIED BY 'your_password'; |
注释掉 /etc/mysql/mysql.conf.d/mysqld.cnf (或类似文件)中的 bind-address = 127.0.0.1
。
重启 MySQL:
service mysql restart |