先更新源 sudo apt-get update;
sudo apt-get install mysql-server 会提示输入密码;
sudo apt-get install mysql-client;
进入到/etc/mysql/mysql.conf.d 编辑mysqld.cnf,将bind_address改为0.0.0.0
进入到mysql mysql -u root -p
允许root用户远程链接到mysql:grant all privileges on . to root@’%’ identified by ‘password’ with grant option;
flush privileges;
重启mysql:sudo /etc/init.d/mysql restart