安裝mysql
sudo apt update
sudo apt install mysql-server
驗(yàn)證
service mysql status
配置遠(yuǎn)程連接 注釋掉bind-address=127.0.0.1
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
登錄到數(shù)據(jù)庫(kù)修改遠(yuǎn)程連接用戶(hù)
use mysql;
update user set host='%' where user='root';
GRANT ALL ON *.* TO 'root'@'%';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'admin';
FLUSH PRIVILEGES;
重啟mysql
sudo systemctl restart mysql.service