1. 安装MYSQL
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient-dev
2.配置远程连接
进入mysql:
mysql -u root -p
使用mysql数据库:
use mysql;
开启远程访问权限:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456';
强制刷新权限:
flush privileges;
或者是重启MYSQL
sudo service mysql restart