先更新源 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