赞
踩
首先,下载MySQL APT 仓库文件, MySQL :: Download MySQL APT Repository. 上有最新版本。
wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb
把仓库文件合并入本机仓库:
dpkg -i mysql-apt-config_0.8.22-1_all.deb
更新数据源:
apt-get update
安装MySQL:
apt-get install mysql-server
安装完后即自动运行,可查看当前状态:
systemctl status mysql
● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2022-04-30 19:57:25 CST; 1min 19s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Main PID: 4263 (mysqld) Status: "Server is operational" Tasks: 37 (limit: 2242) Memory: 366.4M CPU: 644ms CGroup: /system.slice/mysql.service └─4263 /usr/sbin/mysqld Apr 30 19:57:24 iZrv8fu4iejmpkZ systemd[1]: Starting MySQL Community Server... Apr 30 19:57:25 iZrv8fu4iejmpkZ systemd[1]: Started MySQL Community Server.
查看当前版本:
mysql -V
mysql Ver 8.0.29 for Linux on x86_64 (MySQL Community Server - GPL)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。