1、下载
sudo apt-get install mysql-server
sudo apt install mysql-client
sudo apt install libmysqlclient-dev
检验是否安装mysql成功
sudo netstat -tap | grep mysql
2、设置mysql允许远程访问
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
注释掉bind-address = 127.0.0.1:
3、配置权限
mysql -uroot -proot
//设置root访问权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root';
flush privileges;
exit;
service mysql restart;