1.更新包
sudo apt update
2.安裝MySQL的apt配置工具
wget https://dev.mysql.com/get/mysql-apt-config_0.8.32-1_all.deb apt install gnupg dpkg -i mysql-apt-config_0.8.32-1_all.deb apt update
3.安裝MySQL,中間會讓設定密碼
sudo apt install mysql-server
4.啟動
sudo systemctl start mysql
5.停止
sudo systemctl stop mysql
6.開機自啟動
sudo systemctl enable mysql
7.狀態
sudo systemctl status mysql
8.登入
sudo mysql -u root -p
如需設定遠端連線請移步此處檢視:https://www.cnblogs.com/lyt520/p/18416206
參考原文地址:https://blog.csdn.net/weixin_71993565/article/details/140324756