下载离线安装包:mysql-server_8.0.29-1ubuntu20.04_amd64.deb-bundle.tar

官网下载:
https://dev.mysql.com/downloads/mysql/

在这里插入图片描述
下载依赖

wget http://archive.ubuntu.com/ubuntu/pool/main/m/mecab/libmecab2_0.996-10build1_amd64.deb

开始安装

tar -xvf mysql-server_8.0.29-1ubuntu20.04_amd64.deb-bundle.tar
dpkg -i mysql-community-client-plugins_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-community-client-core_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-common_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-community-client_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i libmysqlclient21_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i libmysqlclient-dev_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-client_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i libmecab2_0.996-10build1_amd64.deb   #依赖包
dpkg -i mysql-community-server-core_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-community-server_8.0.29-1ubuntu20.04_amd64.deb
dpkg -i mysql-server_8.0.29-1ubuntu20.04_amd64.deb

查看服务状态

root@ccont:~# mysql -V
mysql  Ver 8.0.29 for Linux on x86_64 (MySQL Community Server - GPL)
root@coconet:~# systemctl status mysql
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-06-07 07:09:54 UTC; 54s ago
       Docs: man:mysqld(8)
             http://dev.mysql.com/doc/refman/en/using-systemd.html
   Main PID: 4370 (mysqld)
     Status: "Server is operational"
      Tasks: 38 (limit: 9272)
     Memory: 359.3M
     CGroup: /system.slice/mysql.service
             └─4370 /usr/sbin/mysqld

Jun 07 07:09:53 coconet systemd[1]: Starting MySQL Community Server...
Jun 07 07:09:54 coconet systemd[1]: Started MySQL Community Server.

root@coconet:~# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.29 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
mysql> 
mysql> 
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐