赞
踩
sudo apt-get update
sudo apt-get install mysql-server
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password';
FLUSH PRIVILEGES;
添加用户并赋予权限
CREATE USER 'remote_user'@'%' IDENTIFIED BY 'Password@123';
GRANT ALL PRIVILEGES ON *.* TO 'remote_user'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
编辑配置文件
sudo nano /etc/mysql/my.cnf
修改 bind-address 配置项
[mysqld]
bind-address = 0.0.0.0
sudo service mysql restart
配置防火墙
sudo ufw allow 3306/tcp
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。