1.0 install mysql
sudo apt purge mysql-server mysql-common sudo apt autoremove mysql-server mysql-common sudo apt-get update sudo apt-get install mysql-server
安裝mysql-server
2.0 change to old password
sudo mysql -u root USE mysql; UPDATE user SET plugin='mysql_native_password' WHERE User='root'; FLUSH PRIVILEGES; exit;
使用舊版的密碼
3.0 bind port
sudo vi /etc/mysql/mysql.cnf
修改mysql.cnf
[mysql] bind-address = 0.0.0.0 [mysqld] bind-address = 0.0.0.0
bind port
sudo /etc/init.d/mysql restart
restart mysql
4.0 add new user
新增權限
5.0 connect
可在外網連接