首先安装需要用到的依赖
apt install wget gnupg lsb-release -y
使用wget获取deb包、安装 | 需要其他版本可前往MySQL官网下载
wget https://dev.mysql.com/get/mysql-apt-config_0.8.28-1_all.deb
dpkg -i mysql-apt-config_0.8.28-1_all.deb
apt update
apt install mysql-server
启动服务、设置开机启动、查看进程状态
systemctl start mysql
systemctl enable mysql
systemctl status mysql
查看MySQL版本
mysql -V
进入MySQL
mysql -u root -p
#Enter password:
#退出数据库
#mysql> quit;
#Bye
查看日志
journalctl -u mysql -xe
tail -f /var/log/mysql/mysqld.log

