!!!非生产环境使用!!!!!!非生产环境使用!!!!!!非生产环境使用!!!
卸载数据库
sudo apt-get remove --purge mysql-server mysql-client mysql-common
清除残留数据(如果有
sudo apt-get autoremove
sudo apt-get autoclean
更新
apt update
安装数据库
sudo apt install mysql-server
查看状态
sudo systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2024-03-04 15:11:39 CST; 9min ago
Main PID: 149398 (mysqld)
Status: "Server is operational"
Tasks: 38 (limit: 4408)
Memory: 364.6M
CGroup: /system.slice/mysql.service
└─149398 /usr/sbin/mysqld
3月 04 15:11:37 ex.example.com systemd[1]: Starting MySQL Community Server...
3月 04 15:11:39 ex.example.com systemd[1]: Started MySQL Community Server.
水一篇