Ubuntu 20.04 安装 mysql 8

apt-get update
apt-cache search mysql | grep '^mysql'
apt-cache search mysql-server-8
apt install -y mysql-server
update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up libhtml-parser-perl (3.72-5) ...
Setting up libhttp-message-perl (6.22-1) ...
Setting up mysql-server-8.0 (8.0.34-0ubuntu0.20.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 3322874
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Setting up libcgi-pm-perl (4.46-1) ...
Setting up libhtml-template-perl (2.97-1) ...
Setting up mysql-server (8.0.34-0ubuntu0.20.04.1) ...
Setting up libcgi-fast-perl (1:2.15-1) ...
Processing triggers for systemd (245.4-4ubuntu3.20) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
# systemctl status mysql.service
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-09-26 08:35:56 UTC; 5min ago
   Main PID: 3323136 (mysqld)
     Status: "Server is operational"
      Tasks: 37 (limit: 1066)
     Memory: 355.0M
     CGroup: /system.slice/mysql.service
             └─3323136 /usr/sbin/mysqld

Sep 26 08:35:54 vultr systemd[1]: Starting MySQL Community Server...
Sep 26 08:35:56 vultr systemd[1]: Started MySQL Community Server.
mysql -u root -p
mysql> SELECT VERSION();
+-------------------------+
| VERSION()               |
+-------------------------+
| 8.0.34-0ubuntu0.20.04.1 |
+-------------------------+
1 row in set (0.00 sec)

mysql>

参考

  1. 下载MySQL huaweicloud.com

你可能感兴趣的:(ubuntu,ubuntu,mysql)