MySQL包安装 -- Debian系列(离线DEB包安装MySQL)

本文涉及的产品
云数据库 RDS SQL Server,基础系列 2核4GB
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS PostgreSQL Serverless,0.5-4RCU 50GB 3个月
推荐场景:
对影评进行热评分析
简介: 本文详细介绍了在Ubuntu 24.04、22.04、20.04及Debian 12系统上,通过离线DEB包安装MySQL 8.0和8.4版本的完整步骤。涵盖下载地址、依赖处理、dpkg安装顺序、配置方法及服务启动验证,确保用户可顺利部署MySQL数据库。

2.2.2.2 离线DEB包安装MySQL

2.2.2.2.1 MySQL 8.0

去“https://www.mysql.com/”网站下载,选择“DOWNLOADS”,如图41所示。

t41

图41 下载MySQL DEB包

选择“MySQL Community (GPL) Downloads”,如图42所示。

t42

图42 下载MySQL DEB包

选择“MySQL Community Server(MySQL社区服务器)”,如图43所示。

t43

图43 下载MySQL DEB包

在“Ubuntu 24.04”上安装MySQL:

"Select Version(选择版本)"为:8.0.43,“Select Operating System(选择操作系统)”为:Ubuntu Linux,"Select OS Version(选择操作系统版本)"为:根据版本选择,"Ubuntu 24.04"选择"Ubuntu Linux 24.04 (x86 , 64-bit)",然后选择”DEB Bundle“后面的”Download“,如图44所示。

t44

图44 下载MySQL DEB包

root@ubuntu2404:~# wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-server_8.0.43-1ubuntu24.04_amd64.deb-bundle.tar

root@ubuntu2404:~# tar xf mysql-server_8.0.43-1ubuntu24.04_amd64.deb-bundle.tar

方法1:dpkg命令安装,要按下面执行的顺序安装,否则会报错

root@ubuntu2404:~# dpkg -i mysql-community-client-plugins_8.0.43-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-community-client-core_8.0.43-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-common_8.0.43-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-community-client_8.0.43-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i libmysqlclient21_8.0.43-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i libmysqlclient-dev_8.0.43-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-client_8.0.43-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-community-server-core_8.0.43-1ubuntu24.04_amd64.deb 
Selecting previously unselected package mysql-community-server-core.
(Reading database ... 87176 files and directories currently installed.)
Preparing to unpack mysql-community-server-core_8.0.43-1ubuntu24.04_amd64.deb ...
Unpacking mysql-community-server-core (8.0.43-1ubuntu24.04) ...
dpkg: dependency problems prevent configuration of mysql-community-server-core:
 mysql-community-server-core depends on libmecab2 (>= 0.996); however:
  Package libmecab2 is not installed. # 提示,没有安装libmecab2依赖包

dpkg: error processing package mysql-community-server-core (--install):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.39-0ubuntu8.6) ...
Processing triggers for man-db (2.12.0-4build2) ...
Errors were encountered while processing:
 mysql-community-server-core

root@ubuntu2404:~# apt install -y libmecab2

root@ubuntu2404:~# dpkg -i mysql-community-server-core_8.0.43-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-community-server_8.0.43-1ubuntu24.04_amd64.deb

输入MySQL root用户密码,然后按下 Enter 键,如图45所示。

t45

图45 输入MySQL root用户密码

在下面提示直接按下 Enter 键,如图46所示。

t46

图46 确认提示信息

选择“Use Strong Password Encryption (RECOMMENDED)”,然后按下 Enter 键,如图47所示。

t47

图47 选择默认身份验证插件

root@ubuntu2404:~# dpkg -i mysql-server_8.0.43-1ubuntu24.04_amd64.deb

方法2:从“https://dev.mysql.com/doc/refman/8.0/en/linux-installation-debian.html”网址看到安装文档:

root@ubuntu2404:~# apt install -y libmecab2

# 预先配置 MySQL 服务器软件包:
root@ubuntu2404:~# dpkg-preconfigure mysql-community-server_*.deb
# 出现图45-47界面,按上面的提示设置。

root@ubuntu2404:~# dpkg -i mysql-{common,community-client-plugins,community-client-core,community-client,client,community-server-core,community-server,server}_*.deb

继续安装MySQL:

root@ubuntu2404:~# systemctl enable --now mysql

root@ubuntu2404:~# ls /var/lib/mysql
 auto.cnf        ca.pem               ib_buffer_pool   mysql                server-cert.pem
 binlog.000001   client-cert.pem      ibdata1          mysql.ibd            server-key.pem
 binlog.000002   client-key.pem       ibtmp1           performance_schema   sys
 binlog.index   '#ib_16384_0.dblwr'  '#innodb_redo'    private_key.pem      undo_001
 ca-key.pem     '#ib_16384_1.dblwr'  '#innodb_temp'    public_key.pem       undo_002

root@ubuntu2404:~# mysql -V
mysql  Ver 8.0.43 for Linux on x86_64 (MySQL Community Server - GPL)

root@ubuntu2404:~# systemctl status mysql
● mysql.service - MySQL Community Server
     Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; preset: enabled)
     Active: active (running) since Wed 2025-10-01 18:25:03 CST; 2min 21s ago
       Docs: man:mysqld(8)
             http://dev.mysql.com/doc/refman/en/using-systemd.html
   Main PID: 1960 (mysqld)
     Status: "Server is operational"
      Tasks: 37 (limit: 2210)
     Memory: 362.7M (peak: 376.8M)
        CPU: 3.042s
     CGroup: /system.slice/mysql.service
             └─1960 /usr/sbin/mysqld

Oct 01 18:25:02 ubuntu2404 systemd[1]: Starting mysql.service - MySQL Community Server...
Oct 01 18:25:03 ubuntu2404 systemd[1]: Started mysql.service - MySQL Community Server.

root@ubuntu2404:~# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.43 MySQL Community Server - GPL

Copyright (c) 2000, 2025, 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> status
--------------
mysql  Ver 8.0.43 for Linux on x86_64 (MySQL Community Server - GPL)

Connection id:        8
Current database:    
Current user:        root@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        8.0.43 MySQL Community Server - GPL
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:        /var/run/mysqld/mysqld.sock
Binary data as:        Hexadecimal
Uptime:            2 min 56 sec

Threads: 2  Questions: 5  Slow queries: 0  Opens: 119  Flush tables: 3  Open tables: 38  Queries per second avg: 0.028
--------------

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

mysql> exit
Bye

在“Ubuntu 22.04”上安装MySQL:

"Select Version(选择版本)"为:8.0.43,“Select Operating System(选择操作系统)”为:Ubuntu Linux,"Select OS Version(选择操作系统版本)"为:根据版本选择,"Ubuntu 22.04"选择"Ubuntu Linux 22.04 (x86 , 64-bit)",然后选择”DEB Bundle“后面的”Download“,如图48所示。

t48

图48 下载MySQL DEB包

root@ubuntu2204:~# wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-server_8.0.43-1ubuntu22.04_amd64.deb-bundle.tar

root@ubuntu2204:~# tar xf mysql-server_8.0.43-1ubuntu22.04_amd64.deb-bundle.tar

方法1:dpkg命令安装,要按下面执行的顺序安装,否则会报错

root@ubuntu2204:~# dpkg -i mysql-community-client-plugins_8.0.43-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-community-client-core_8.0.43-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-common_8.0.43-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-community-client_8.0.43-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i libmysqlclient21_8.0.43-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i libmysqlclient-dev_8.0.43-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-client_8.0.43-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-community-server-core_8.0.43-1ubuntu22.04_amd64.deb 
Selecting previously unselected package mysql-community-server-core.
(Reading database ... 74799 files and directories currently installed.)
Preparing to unpack mysql-community-server-core_8.0.43-1ubuntu22.04_amd64.deb ...
Unpacking mysql-community-server-core (8.0.43-1ubuntu22.04) ...
dpkg: dependency problems prevent configuration of mysql-community-server-core:
 mysql-community-server-core depends on libmecab2 (>= 0.996); however:
  Package libmecab2 is not installed. # 提示,没有安装libmecab2依赖包

dpkg: error processing package mysql-community-server-core (--install):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.35-0ubuntu3.8) ...
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
 mysql-community-server-core

root@ubuntu2204:~# apt install -y libmecab2

root@ubuntu2204:~# dpkg -i mysql-community-server-core_8.0.43-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-community-server_8.0.43-1ubuntu22.04_amd64.deb
# 出现图45-47界面,按上面的提示设置.

root@ubuntu2204:~# dpkg -i mysql-server_8.0.43-1ubuntu22.04_amd64.deb

方法2:从“https://dev.mysql.com/doc/refman/8.0/en/linux-installation-debian.html”网址看到安装文档:

root@ubuntu2204:~# apt install -y libmecab2

# 预先配置 MySQL 服务器软件包:
root@ubuntu2204:~# dpkg-preconfigure mysql-community-server_*.deb
# 出现图45-47界面,按上面的提示设置。

root@ubuntu2204:~# dpkg -i mysql-{common,community-client-plugins,community-client-core,community-client,client,community-server-core,community-server,server}_*.deb

继续安装MySQL:

root@ubuntu2204:~# systemctl enable --now mysql

root@ubuntu2204:~# ls /var/lib/mysql
 auto.cnf        ca.pem               ib_buffer_pool   mysql                server-cert.pem
 binlog.000001   client-cert.pem      ibdata1          mysql.ibd            server-key.pem
 binlog.000002   client-key.pem       ibtmp1           performance_schema   sys
 binlog.index   '#ib_16384_0.dblwr'  '#innodb_redo'    private_key.pem      undo_001
 ca-key.pem     '#ib_16384_1.dblwr'  '#innodb_temp'    public_key.pem       undo_002

root@ubuntu2204:~# mysql -V
mysql  Ver 8.0.43 for Linux on x86_64 (MySQL Community Server - GPL)

root@ubuntu2204:~# systemctl status mysql
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2025-10-02 19:08:40 CST; 2min 17s ago
       Docs: man:mysqld(8)
             http://dev.mysql.com/doc/refman/en/using-systemd.html
   Main PID: 2020 (mysqld)
     Status: "Server is operational"
      Tasks: 37 (limit: 2176)
     Memory: 362.9M
        CPU: 2.309s
     CGroup: /system.slice/mysql.service
             └─2020 /usr/sbin/mysqld

Oct 02 19:08:40 ubuntu2204 systemd[1]: Starting MySQL Community Server...
Oct 02 19:08:40 ubuntu2204 systemd[1]: Started MySQL Community Server.

root@ubuntu2204:~# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.43 MySQL Community Server - GPL

Copyright (c) 2000, 2025, 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> status
--------------
mysql  Ver 8.0.43 for Linux on x86_64 (MySQL Community Server - GPL)

Connection id:        8
Current database:    
Current user:        root@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        8.0.43 MySQL Community Server - GPL
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:        /var/run/mysqld/mysqld.sock
Binary data as:        Hexadecimal
Uptime:            2 min 36 sec

Threads: 2  Questions: 5  Slow queries: 0  Opens: 119  Flush tables: 3  Open tables: 38  Queries per second avg: 0.032
--------------

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql> exit
Bye

在“Ubuntu 20.04”上安装MySQL:

"Select Version(选择版本)"为:8.0.43,“Select Operating System(选择操作系统)”为:Ubuntu Linux,"Select OS Version(选择操作系统版本)"为:根据版本选择,"Ubuntu 20.04"选择"Ubuntu Linux 20.04 (x86 , 64-bit)",然后选择”DEB Bundle“后面的”Download“,如图49所示。

t49

图49 下载MySQL DEB包

root@ubuntu2004:~# wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-server_8.0.43-1ubuntu20.04_amd64.deb-bundle.tar

root@ubuntu2004:~# tar xf mysql-server_8.0.43-1ubuntu20.04_amd64.deb-bundle.tar

方法1:dpkg命令安装,要按下面执行的顺序安装,否则会报错

root@ubuntu2004:~# dpkg -i mysql-community-client-plugins_8.0.43-1ubuntu20.04_amd64.deb

root@ubuntu2004:~# dpkg -i mysql-community-client-core_8.0.43-1ubuntu20.04_amd64.deb

root@ubuntu2004:~# dpkg -i mysql-common_8.0.43-1ubuntu20.04_amd64.deb

root@ubuntu2004:~# dpkg -i mysql-community-client_8.0.43-1ubuntu20.04_amd64.deb

root@ubuntu2004:~# dpkg -i libmysqlclient21_8.0.43-1ubuntu20.04_amd64.deb

root@ubuntu2004:~# dpkg -i libmysqlclient-dev_8.0.43-1ubuntu20.04_amd64.deb

root@ubuntu2004:~# dpkg -i mysql-client_8.0.43-1ubuntu20.04_amd64.deb

root@ubuntu2004:~# dpkg -i mysql-community-server-core_8.0.43-1ubuntu20.04_amd64.deb 
Selecting previously unselected package mysql-community-server-core.
(Reading database ... 72420 files and directories currently installed.)
Preparing to unpack mysql-community-server-core_8.0.43-1ubuntu20.04_amd64.deb ...
Unpacking mysql-community-server-core (8.0.43-1ubuntu20.04) ...
dpkg: dependency problems prevent configuration of mysql-community-server-core:
 mysql-community-server-core depends on libmecab2 (>= 0.996); however:
  Package libmecab2 is not installed. # 提示,没有安装libmecab2包
 mysql-community-server-core depends on libtirpc3 (>= 1.0.2); however:
  Package libtirpc3 is not installed. # 提示,没有安装libtirpc3包

dpkg: error processing package mysql-community-server-core (--install):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 mysql-community-server-core

root@ubuntu2004:~# apt install -y libmecab2 libtirpc3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libtirpc3 : Depends: libtirpc-common (>= 1.2.5-1ubuntu0.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
# 这里会报错

# 执行下面命令安装
root@ubuntu2004:~# apt --fix-broken install

root@ubuntu2004:~# dpkg -i mysql-community-server-core_8.0.43-1ubuntu20.04_amd64.deb

root@ubuntu2004:~# dpkg -i mysql-community-server_8.0.43-1ubuntu20.04_amd64.debb
# 出现图45-47界面,按上面的提示设置。

root@ubuntu2004:~# dpkg -i mysql-server_8.0.43-1ubuntu20.04_amd64.deb

方法2:从“https://dev.mysql.com/doc/refman/8.0/en/linux-installation-debian.html”网址看到安装文档:

root@ubuntu2004:~# apt install -y libmecab2 libtirpc3

# 预先配置 MySQL 服务器软件包:
root@ubuntu2004:~# dpkg-preconfigure mysql-community-server_*.deb
# 出现图45-47界面,按上面的提示设置。

root@ubuntu2004:~# dpkg -i mysql-{common,community-client-plugins,community-client-core,community-client,client,community-server-core,community-server,server}_*.deb

继续安装MySQL:

root@ubuntu2004:~# systemctl enable --now mysql

root@ubuntu2004:~# ls /var/lib/mysql
 auto.cnf        ca.pem               ib_buffer_pool   mysql                server-cert.pem
 binlog.000001   client-cert.pem      ibdata1          mysql.ibd            server-key.pem
 binlog.000002   client-key.pem       ibtmp1           performance_schema   sys
 binlog.index   '#ib_16384_0.dblwr'  '#innodb_redo'    private_key.pem      undo_001
 ca-key.pem     '#ib_16384_1.dblwr'  '#innodb_temp'    public_key.pem       undo_002

root@ubuntu2004:~# mysql -V
mysql  Ver 8.0.43 for Linux on x86_64 (MySQL Community Server - GPL)

root@ubuntu2004:~# systemctl status mysql
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2025-10-02 19:37:39 CST; 1min 35s ago
       Docs: man:mysqld(8)
             http://dev.mysql.com/doc/refman/en/using-systemd.html
   Main PID: 2633 (mysqld)
     Status: "Server is operational"
      Tasks: 37 (limit: 2218)
     Memory: 363.5M
     CGroup: /system.slice/mysql.service
             └─2633 /usr/sbin/mysqld

Oct 02 19:37:39 ubuntu2004 systemd[1]: Starting MySQL Community Server...
Oct 02 19:37:39 ubuntu2004 systemd[1]: Started MySQL Community Server.

root@ubuntu2004:~# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.43 MySQL Community Server - GPL

Copyright (c) 2000, 2025, 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> status
--------------
mysql  Ver 8.0.43 for Linux on x86_64 (MySQL Community Server - GPL)

Connection id:        8
Current database:    
Current user:        root@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        8.0.43 MySQL Community Server - GPL
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:        /var/run/mysqld/mysqld.sock
Binary data as:        Hexadecimal
Uptime:            1 min 57 sec

Threads: 2  Questions: 5  Slow queries: 0  Opens: 119  Flush tables: 3  Open tables: 38  Queries per second avg: 0.042
--------------

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql> exit
Bye

在“Debian 12”上安装MySQL:

"Select Version(选择版本)"为:8.0.43,“Select Operating System(选择操作系统)”为:Debian Linux,然后选择”DEB Bundle“后面的”Download“,如图50所示。

t50

图50 下载MySQL DEB包

root@debian12:~# wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-server_8.0.43-1debian12_amd64.deb-bundle.tar

root@debian12:~# tar xf mysql-server_8.0.43-1debian12_amd64.deb-bundle.tar

方法1:dpkg命令安装,要按下面执行的顺序安装,否则会报错

root@debian12:~# dpkg -i mysql-community-client-plugins_8.0.43-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-community-client-core_8.0.43-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-common_8.0.43-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-community-client_8.0.43-1debian12_amd64.deb

root@debian12:~# dpkg -i libmysqlclient21_8.0.43-1debian12_amd64.debb

root@debian12:~# dpkg -i libmysqlclient-dev_8.0.43-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-client_8.0.43-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-community-server-core_8.0.43-1debian12_amd64.deb
Selecting previously unselected package mysql-community-server-core.
(Reading database ... 33672 files and directories currently installed.)
Preparing to unpack mysql-community-server-core_8.0.43-1debian12_amd64.deb ...
Unpacking mysql-community-server-core (8.0.43-1debian12) ...
dpkg: dependency problems prevent configuration of mysql-community-server-core:
 mysql-community-server-core depends on libaio1 (>= 0.3.93); however:
  Package libaio1 is not installed. # 提示,没有安装libaio1包
 mysql-community-server-core depends on libmecab2 (>= 0.996); however:
  Package libmecab2 is not installed. # 提示,没有安装libmecab2包
 mysql-community-server-core depends on libnuma1 (>= 2.0.11); however:
  Package libnuma1 is not installed. # 提示,没有安装libnuma1包

dpkg: error processing package mysql-community-server-core (--install):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.36-9+deb12u10) ...
Processing triggers for man-db (2.11.2-2) ...
Errors were encountered while processing:
 mysql-community-server-core

root@debian12:~# apt install -y libaio1 libmecab2 libnuma1

root@debian12:~# dpkg -i mysql-community-server-core_8.0.43-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-community-server_8.0.43-1debian12_amd64.deb 
(Reading database ... 33880 files and directories currently installed.)
Preparing to unpack mysql-community-server_8.0.43-1debian12_amd64.deb ...
Unpacking mysql-community-server (8.0.43-1debian12) over (8.0.43-1debian12) ...
dpkg: dependency problems prevent configuration of mysql-community-server:
 mysql-community-server depends on psmisc; however:
  Package psmisc is not installed. # 提示,没有安装psmisc包

dpkg: error processing package mysql-community-server (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-community-server

root@debian12:~# apt install -y psmisc

输入MySQL root用户密码,然后按下 Enter 键,如图51所示。

t51

图51 输入MySQL root用户密码

在下面提示直接按下 Enter 键,如图52所示。

t52

图52 确认提示信息

选择“Use Strong Password Encryption (RECOMMENDED)”,然后按下 Enter 键,如图53所示。

t53

图53 选择默认身份验证插件

root@debian12:~# dpkg -i mysql-community-server_8.0.43-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-server_8.0.43-1debian12_amd64.deb

方法2:从“https://dev.mysql.com/doc/refman/8.0/en/linux-installation-debian.html”网址看到安装文档:

root@debian12:~# apt install -y libaio1 libmecab2 libnuma1 psmisc

# 预先配置 MySQL 服务器软件包:
root@debian12:~# dpkg-preconfigure mysql-community-server_*.deb
# 出现图图51-53界面,按上面的提示设置。

root@debian12:~# dpkg -i mysql-{common,community-client-plugins,community-client-core,community-client,client,community-server-core,community-server,server}_*.deb

继续安装MySQL:

root@debian12:~# systemctl enable --now mysql

root@debian12:~# ls /var/lib/mysql
 auto.cnf     binlog.index      '#ib_16384_0.dblwr'  '#innodb_redo'         private_key.pem   undo_001
 binlog.000001     ca-key.pem      '#ib_16384_1.dblwr'  '#innodb_temp'         public_key.pem    undo_002
 binlog.000002     ca.pem           ib_buffer_pool       mysql             server-cert.pem
 binlog.000003     client-cert.pem   ibdata1            mysql.ibd         server-key.pem
 binlog.000004     client-key.pem    ibtmp1            performance_schema   sys

root@debian12:~# mysql -V
mysql  Ver 8.0.43 for Linux on x86_64 (MySQL Community Server - GPL)

root@debian12:~# systemctl status mysql
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; preset: enabled)
     Active: active (running) since Wed 2025-10-01 21:58:59 CST; 54s ago
       Docs: man:mysqld(8)
             http://dev.mysql.com/doc/refman/en/using-systemd.html
   Main PID: 1598 (mysqld)
     Status: "Server is operational"
      Tasks: 38 (limit: 2273)
     Memory: 368.2M
        CPU: 1.435s
     CGroup: /system.slice/mysql.service
             └─1598 /usr/sbin/mysqld

Oct 01 21:58:59 debian12 systemd[1]: Starting mysql.service - MySQL Community Server...
Oct 01 21:58:59 debian12 systemd[1]: Started mysql.service - MySQL Community Server.

root@debian12:~# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.43 MySQL Community Server - GPL

Copyright (c) 2000, 2025, 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> status
--------------
mysql  Ver 8.0.43 for Linux on x86_64 (MySQL Community Server - GPL)

Connection id:        8
Current database:    
Current user:        root@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        8.0.43 MySQL Community Server - GPL
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:        /var/run/mysqld/mysqld.sock
Binary data as:        Hexadecimal
Uptime:            1 min 19 sec

Threads: 2  Questions: 5  Slow queries: 0  Opens: 119  Flush tables: 3  Open tables: 38  Queries per second avg: 0.063
--------------

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql> exit
Bye
2.2.2.2.2 MySQL 8.4

去“https://www.mysql.com/”网站下载,选择“DOWNLOADS”,如图54所示。

t54

图54 下载MySQL DEB包

选择“MySQL Community (GPL) Downloads”,如图55所示。

t55

图55 下载MySQL DEB包

选择“MySQL Community Server(MySQL社区服务器)”,如图56所示。

t56

图56 下载MySQL DEB包

在“Ubuntu 24.04”上安装MySQL:

"Select Version(选择版本)"为:8.4.6 LTS,“Select Operating System(选择操作系统)”为:Ubuntu Linux,"Select OS Version(选择操作系统版本)"为:根据版本选择,"Ubuntu 24.04"选择"Ubuntu Linux 24.04 (x86 , 64-bit)",然后选择”DEB Bundle“后面的”Download“,如图57所示。

t57

图57 下载MySQL DEB包

root@ubuntu2404:~# wget https://cdn.mysql.com//Downloads/MySQL-8.4/mysql-server_8.4.6-1ubuntu24.04_amd64.deb-bundle.tar

root@ubuntu2404:~# tar xf mysql-server_8.4.6-1ubuntu24.04_amd64.deb-bundle.tar

方法1:dpkg命令安装,要按下面执行的顺序安装,否则会报错

root@ubuntu2404:~# dpkg -i mysql-community-client-plugins_8.4.6-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-community-client-core_8.4.6-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-common_8.4.6-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-community-client_8.4.6-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i libmysqlclient24_8.4.6-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i libmysqlclient-dev_8.4.6-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-client_8.4.6-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-community-server-core_8.4.6-1ubuntu24.04_amd64.deb 
Selecting previously unselected package mysql-community-server-core.
(Reading database ... 87174 files and directories currently installed.)
Preparing to unpack mysql-community-server-core_8.4.6-1ubuntu24.04_amd64.deb ...
Unpacking mysql-community-server-core (8.4.6-1ubuntu24.04) ...
dpkg: dependency problems prevent configuration of mysql-community-server-core:
 mysql-community-server-core depends on libmecab2 (>= 0.996); however:
  Package libmecab2 is not installed. # 提示,没有安装libmecab2依赖包

dpkg: error processing package mysql-community-server-core (--install):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.39-0ubuntu8.6) ...
Processing triggers for man-db (2.12.0-4build2) ...
Errors were encountered while processing:
 mysql-community-server-core

root@ubuntu2404:~# apt install -y libmecab2

root@ubuntu2404:~# dpkg -i mysql-community-server-core_8.4.6-1ubuntu24.04_amd64.deb

root@ubuntu2404:~# dpkg -i mysql-community-server_8.4.6-1ubuntu24.04_amd64.deb

输入MySQL root用户密码,然后按下 Enter 键,如图58所示。

t58

图58 输入MySQL root用户密码

root@ubuntu2404:~# dpkg -i mysql-server_8.4.6-1ubuntu24.04_amd64.deb

方法2:从“https://dev.mysql.com/doc/refman/8.4/en/linux-installation-debian.html”网址看到安装文档:

root@ubuntu2404:~# apt install -y libmecab2

# 预先配置 MySQL 服务器软件包:
root@ubuntu2404:~# dpkg-preconfigure mysql-community-server_*.deb
# 出现图58界面,按上面的提示设置。

root@ubuntu2404:~# dpkg -i mysql-{common,community-client-plugins,community-client-core,community-client,client,community-server-core,community-server,server}_*.deb

继续安装MySQL:

root@ubuntu2404:~# systemctl enable --now mysql

root@ubuntu2404:~# ls /var/lib/mysql
 auto.cnf        ca.pem               ib_buffer_pool   mysql                   public_key.pem    undo_002
 binlog.000001   client-cert.pem      ibdata1          mysql.ibd               server-cert.pem
 binlog.000002   client-key.pem       ibtmp1           mysql_upgrade_history   server-key.pem
 binlog.index   '#ib_16384_0.dblwr'  '#innodb_redo'    performance_schema      sys
 ca-key.pem     '#ib_16384_1.dblwr'  '#innodb_temp'    private_key.pem         undo_001

root@ubuntu2404:~# mysql -V
mysql  Ver 8.4.6 for Linux on x86_64 (MySQL Community Server - GPL)

root@ubuntu2404:~# systemctl status mysql
● mysql.service - MySQL Community Server
     Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; preset: enabled)
     Active: active (running) since Fri 2025-10-03 11:33:03 CST; 1min 54s ago
       Docs: man:mysqld(8)
             http://dev.mysql.com/doc/refman/en/using-systemd.html
   Main PID: 1970 (mysqld)
     Status: "Server is operational"
      Tasks: 34 (limit: 2210)
     Memory: 420.1M (peak: 434.3M)
        CPU: 2.380s
     CGroup: /system.slice/mysql.service
             └─1970 /usr/sbin/mysqld

Oct 03 11:33:02 ubuntu2404 systemd[1]: Starting mysql.service - MySQL Community Server...
Oct 03 11:33:03 ubuntu2404 systemd[1]: Started mysql.service - MySQL Community Server.

root@ubuntu2404:~# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.4.6 MySQL Community Server - GPL

Copyright (c) 2000, 2025, 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> status
--------------
mysql  Ver 8.4.6 for Linux on x86_64 (MySQL Community Server - GPL)

Connection id:        8
Current database:    
Current user:        root@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        8.4.6 MySQL Community Server - GPL
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:        /var/run/mysqld/mysqld.sock
Binary data as:        Hexadecimal
Uptime:            2 min 16 sec

Threads: 2  Questions: 6  Slow queries: 0  Opens: 119  Flush tables: 3  Open tables: 38  Queries per second avg: 0.044
--------------

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

mysql> exit
Bye

在“Ubuntu 22.04”上安装MySQL:

"Select Version(选择版本)"为:8.4.6 LTS,“Select Operating System(选择操作系统)”为:Ubuntu Linux,"Select OS Version(选择操作系统版本)"为:根据版本选择,"Ubuntu 22.04"选择"Ubuntu Linux 22.04 (x86 , 64-bit)",然后选择”DEB Bundle“后面的”Download“,如图59所示。

t59

图59 下载MySQL DEB包

root@ubuntu2204:~#  wget https://cdn.mysql.com//Downloads/MySQL-8.4/mysql-server_8.4.6-1ubuntu22.04_amd64.deb-bundle.tar

root@ubuntu2204:~# tar xf mysql-server_8.4.6-1ubuntu22.04_amd64.deb-bundle.tar

方法1:dpkg命令安装,要按下面执行的顺序安装,否则会报错

root@ubuntu2204:~# dpkg -i mysql-community-client-plugins_8.4.6-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-community-client-core_8.4.6-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-common_8.4.6-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-community-client_8.4.6-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i libmysqlclient24_8.4.6-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i libmysqlclient-dev_8.4.6-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-client_8.4.6-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-community-server-core_8.4.6-1ubuntu22.04_amd64.deb 
Selecting previously unselected package mysql-community-server-core.
(Reading database ... 74797 files and directories currently installed.)
Preparing to unpack mysql-community-server-core_8.4.6-1ubuntu22.04_amd64.deb ...
Unpacking mysql-community-server-core (8.4.6-1ubuntu22.04) ...
dpkg: dependency problems prevent configuration of mysql-community-server-core:
 mysql-community-server-core depends on libmecab2 (>= 0.996); however:
  Package libmecab2 is not installed. # 提示,没有安装libmecab2依赖包

dpkg: error processing package mysql-community-server-core (--install):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.35-0ubuntu3.8) ...
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
 mysql-community-server-core

root@ubuntu2404:~# apt install -y libmecab2

root@ubuntu2204:~# dpkg -i mysql-community-server-core_8.4.6-1ubuntu22.04_amd64.deb

root@ubuntu2204:~# dpkg -i mysql-community-server_8.4.6-1ubuntu22.04_amd64.deb
# 出现图58界面,按上面的提示设置。

root@ubuntu2204:~# dpkg -i mysql-server_8.4.6-1ubuntu22.04_amd64.deb

方法2:从“https://dev.mysql.com/doc/refman/8.4/en/linux-installation-debian.html”网址看到安装文档:

root@ubuntu2204:~# apt install -y libmecab2

# 预先配置 MySQL 服务器软件包:
root@ubuntu2204:~# dpkg-preconfigure mysql-community-server_*.deb
# 出现图58界面,按上面的提示设置。

root@ubuntu2204:~# dpkg -i mysql-{common,community-client-plugins,community-client-core,community-client,client,community-server-core,community-server,server}_*.deb

继续安装MySQL:

root@ubuntu2204:~# systemctl enable --now mysql

root@ubuntu2204:~# ls /var/lib/mysql
 auto.cnf        ca.pem               ib_buffer_pool   mysql                   public_key.pem    undo_002
 binlog.000001   client-cert.pem      ibdata1          mysql.ibd               server-cert.pem
 binlog.000002   client-key.pem       ibtmp1           mysql_upgrade_history   server-key.pem
 binlog.index   '#ib_16384_0.dblwr'  '#innodb_redo'    performance_schema      sys
 ca-key.pem     '#ib_16384_1.dblwr'  '#innodb_temp'    private_key.pem         undo_001

root@ubuntu2204:~# mysql -V
mysql  Ver 8.4.6 for Linux on x86_64 (MySQL Community Server - GPL)

root@ubuntu2204:~# systemctl status mysql
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2025-10-03 11:57:11 CST; 1min 37s ago
       Docs: man:mysqld(8)
             http://dev.mysql.com/doc/refman/en/using-systemd.html
   Main PID: 2865 (mysqld)
     Status: "Server is operational"
      Tasks: 34 (limit: 2176)
     Memory: 420.8M
        CPU: 1.912s
     CGroup: /system.slice/mysql.service
             └─2865 /usr/sbin/mysqld

Oct 03 11:57:11 ubuntu2204 systemd[1]: Starting MySQL Community Server...
Oct 03 11:57:11 ubuntu2204 systemd[1]: Started MySQL Community Server.

root@ubuntu2204:~# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.4.6 MySQL Community Server - GPL

Copyright (c) 2000, 2025, 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> status
--------------
mysql  Ver 8.4.6 for Linux on x86_64 (MySQL Community Server - GPL)

Connection id:        8
Current database:    
Current user:        root@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        8.4.6 MySQL Community Server - GPL
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:        /var/run/mysqld/mysqld.sock
Binary data as:        Hexadecimal
Uptime:            1 min 56 sec

Threads: 2  Questions: 6  Slow queries: 0  Opens: 119  Flush tables: 3  Open tables: 38  Queries per second avg: 0.051
--------------

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

mysql> exit
Bye

在“Debian 12”上安装MySQL:

"Select Version(选择版本)"为:8.4.6 LTS,“Select Operating System(选择操作系统)”为:Debian Linux,然后选择”DEB Bundle“后面的”Download“,如图60所示。

t60

图60 下载MySQL DEB包

root@debian12:~# wget https://cdn.mysql.com//Downloads/MySQL-8.4/mysql-server_8.4.6-1debian12_amd64.deb-bundle.tar

root@debian12:~# tar xf mysql-server_8.4.6-1debian12_amd64.deb-bundle.tar

方法1:dpkg命令安装,要按下面执行的顺序安装,否则会报错

root@debian12:~# dpkg -i mysql-community-client-plugins_8.4.6-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-community-client-core_8.4.6-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-common_8.4.6-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-community-client_8.4.6-1debian12_amd64.deb

root@debian12:~# dpkg -i libmysqlclient24_8.4.6-1debian12_amd64.deb

root@debian12:~# dpkg -i libmysqlclient-dev_8.4.6-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-client_8.4.6-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-community-server-core_8.4.6-1debian12_amd64.deb 
Selecting previously unselected package mysql-community-server-core.
(Reading database ... 33670 files and directories currently installed.)
Preparing to unpack mysql-community-server-core_8.4.6-1debian12_amd64.deb ...
Unpacking mysql-community-server-core (8.4.6-1debian12) ...
dpkg: dependency problems prevent configuration of mysql-community-server-core:
 mysql-community-server-core depends on libaio1 (>= 0.3.93); however:
  Package libaio1 is not installed. # 提示,没有安装libaio1依赖包
 mysql-community-server-core depends on libmecab2 (>= 0.996); however:
  Package libmecab2 is not installed. # 提示,没有安装libmecab2依赖包
 mysql-community-server-core depends on libnuma1 (>= 2.0.11); however:
  Package libnuma1 is not installed. # 提示,没有安装libnuma1依赖包

dpkg: error processing package mysql-community-server-core (--install):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.36-9+deb12u10) ...
Processing triggers for man-db (2.11.2-2) ...
Errors were encountered while processing:
 mysql-community-server-core

root@debian12:~# apt install -y libaio1 libmecab2 libnuma1

root@debian12:~# dpkg -i mysql-community-server-core_8.4.6-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-community-server_8.4.6-1debian12_amd64.deb 
Selecting previously unselected package mysql-community-server.
(Reading database ... 33934 files and directories currently installed.)
Preparing to unpack mysql-community-server_8.4.6-1debian12_amd64.deb ...
adduser: Warning: The home dir /var/lib/mysql you specified can't be accessed: No such file or directory
Unpacking mysql-community-server (8.4.6-1debian12) ...
dpkg: dependency problems prevent configuration of mysql-community-server:
 mysql-community-server depends on psmisc; however:
  Package psmisc is not installed. # 提示,没有安装psmisc依赖包

dpkg: error processing package mysql-community-server (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-community-server

root@debian12:~# apt install -y  psmisc

输入MySQL root用户密码,然后按下 Enter 键,如图61所示。

t61

图61 输入MySQL root用户密码

root@debian12:~# dpkg -i mysql-community-server_8.4.6-1debian12_amd64.deb

root@debian12:~# dpkg -i mysql-server_8.4.6-1debian12_amd64.deb

方法2:从“https://dev.mysql.com/doc/refman/8.4/en/linux-installation-debian.html”网址看到安装文档:

root@debian12:~# apt install -y libaio1 libmecab2 libnuma1 psmisc

# 预先配置 MySQL 服务器软件包:
root@debian12:~# dpkg-preconfigure mysql-community-server_*.deb
# 出现图61界面,按上面的提示设置。

root@debian12:~# dpkg -i mysql-{common,community-client-plugins,community-client-core,community-client,client,community-server-core,community-server,server}_*.deb

继续安装MySQL:

root@debian12:~# systemctl enable --now mysql

root@debian12:~# ls /var/lib/mysql
 auto.cnf     binlog.index      '#ib_16384_0.dblwr'  '#innodb_redo'            performance_schema   sys
 binlog.000001     ca-key.pem      '#ib_16384_1.dblwr'  '#innodb_temp'            private_key.pem      undo_001
 binlog.000002     ca.pem           ib_buffer_pool       mysql                public_key.pem         undo_002
 binlog.000003     client-cert.pem   ibdata1            mysql.ibd            server-cert.pem
 binlog.000004     client-key.pem    ibtmp1            mysql_upgrade_history   server-key.pem

root@debian12:~# mysql -V
mysql  Ver 8.4.6 for Linux on x86_64 (MySQL Community Server - GPL)

root@debian12:~# systemctl status mysql
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; preset: enabled)
     Active: active (running) since Fri 2025-10-03 12:42:24 CST; 1min 47s ago
       Docs: man:mysqld(8)
             http://dev.mysql.com/doc/refman/en/using-systemd.html
   Main PID: 1544 (mysqld)
     Status: "Server is operational"
      Tasks: 34 (limit: 2273)
     Memory: 428.0M
        CPU: 2.267s
     CGroup: /system.slice/mysql.service
             └─1544 /usr/sbin/mysqld

Oct 03 12:42:23 debian12 systemd[1]: Starting mysql.service - MySQL Community Server...
Oct 03 12:42:24 debian12 systemd[1]: Started mysql.service - MySQL Community Server.

root@debian12:~# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.4.6 MySQL Community Server - GPL

Copyright (c) 2000, 2025, 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> status
--------------
mysql  Ver 8.4.6 for Linux on x86_64 (MySQL Community Server - GPL)

Connection id:        8
Current database:    
Current user:        root@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        8.4.6 MySQL Community Server - GPL
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:        /var/run/mysqld/mysqld.sock
Binary data as:        Hexadecimal
Uptime:            2 min 6 sec

Threads: 2  Questions: 6  Slow queries: 0  Opens: 119  Flush tables: 3  Open tables: 38  Queries per second avg: 0.047
--------------

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql> exit
Bye
相关文章
|
8天前
|
存储 关系型数据库 分布式数据库
PostgreSQL 18 发布,快来 PolarDB 尝鲜!
PostgreSQL 18 发布,PolarDB for PostgreSQL 全面兼容。新版本支持异步I/O、UUIDv7、虚拟生成列、逻辑复制增强及OAuth认证,显著提升性能与安全。PolarDB-PG 18 支持存算分离架构,融合海量弹性存储与极致计算性能,搭配丰富插件生态,为企业提供高效、稳定、灵活的云数据库解决方案,助力企业数字化转型如虎添翼!
|
7天前
|
存储 人工智能 Java
AI 超级智能体全栈项目阶段二:Prompt 优化技巧与学术分析 AI 应用开发实现上下文联系多轮对话
本文讲解 Prompt 基本概念与 10 个优化技巧,结合学术分析 AI 应用的需求分析、设计方案,介绍 Spring AI 中 ChatClient 及 Advisors 的使用。
337 130
AI 超级智能体全栈项目阶段二:Prompt 优化技巧与学术分析 AI 应用开发实现上下文联系多轮对话
|
19天前
|
弹性计算 关系型数据库 微服务
基于 Docker 与 Kubernetes(K3s)的微服务:阿里云生产环境扩容实践
在微服务架构中,如何实现“稳定扩容”与“成本可控”是企业面临的核心挑战。本文结合 Python FastAPI 微服务实战,详解如何基于阿里云基础设施,利用 Docker 封装服务、K3s 实现容器编排,构建生产级微服务架构。内容涵盖容器构建、集群部署、自动扩缩容、可观测性等关键环节,适配阿里云资源特性与服务生态,助力企业打造低成本、高可靠、易扩展的微服务解决方案。
1331 8
|
7天前
|
人工智能 Java API
AI 超级智能体全栈项目阶段一:AI大模型概述、选型、项目初始化以及基于阿里云灵积模型 Qwen-Plus实现模型接入四种方式(SDK/HTTP/SpringAI/langchain4j)
本文介绍AI大模型的核心概念、分类及开发者学习路径,重点讲解如何选择与接入大模型。项目基于Spring Boot,使用阿里云灵积模型(Qwen-Plus),对比SDK、HTTP、Spring AI和LangChain4j四种接入方式,助力开发者高效构建AI应用。
329 122
AI 超级智能体全栈项目阶段一:AI大模型概述、选型、项目初始化以及基于阿里云灵积模型 Qwen-Plus实现模型接入四种方式(SDK/HTTP/SpringAI/langchain4j)
|
6天前
|
监控 JavaScript Java
基于大模型技术的反欺诈知识问答系统
随着互联网与金融科技发展,网络欺诈频发,构建高效反欺诈平台成为迫切需求。本文基于Java、Vue.js、Spring Boot与MySQL技术,设计实现集欺诈识别、宣传教育、用户互动于一体的反欺诈系统,提升公众防范意识,助力企业合规与用户权益保护。
|
18天前
|
机器学习/深度学习 人工智能 前端开发
通义DeepResearch全面开源!同步分享可落地的高阶Agent构建方法论
通义研究团队开源发布通义 DeepResearch —— 首个在性能上可与 OpenAI DeepResearch 相媲美、并在多项权威基准测试中取得领先表现的全开源 Web Agent。
1417 87
|
6天前
|
JavaScript Java 大数据
基于JavaWeb的销售管理系统设计系统
本系统基于Java、MySQL、Spring Boot与Vue.js技术,构建高效、可扩展的销售管理平台,实现客户、订单、数据可视化等全流程自动化管理,提升企业运营效率与决策能力。
|
7天前
|
弹性计算 安全 数据安全/隐私保护
2025年阿里云域名备案流程(新手图文详细流程)
本文图文详解阿里云账号注册、服务器租赁、域名购买及备案全流程,涵盖企业实名认证、信息模板创建、域名备案提交与管局审核等关键步骤,助您快速完成网站上线前的准备工作。
258 82
2025年阿里云域名备案流程(新手图文详细流程)