分类: MySQL
Debian11服务器上使用apt快速部署MySQL8.0.31

Debian11上使用apt方式快速部署安装MySQL8.0.31数据库步骤如下:
mysql-debian.jpg
1、先更新系统:

apt update
apt upgrade

2、安装 MySQL APT 存储库:

wget https://dev.mysql.com/get/mysql-apt-config_0.8.24-1_all.deb
dpkg -i mysql-apt-config_0.8.24-1_all.deb

在 MySQL 存储库安装过程中,如果出现提示,请选择 Debian buster 的存储库,然后按 TAB 键选择 Ok,按 ENTER 继续。
如下图:
1.png
2.png

3、安装MySQL8服务器包:

apt update
apt install mysql-server

如下图,设置mysql密码
3.png
安装完成后,MySQL服务将自动启动,进行安全设置:

mysql_secure_installation

4、登录控制台:

root@debian115# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.31 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> \s
--------------
mysql  Ver 8.0.31 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.31 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:            /data/mysql/mysql.sock
Binary data as:         Hexadecimal
Uptime:                 1 min 16 sec

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

注意事项:
Debian11上安装my.cnf配置文件在/etc/mysql目录下面,根据实际需求场景修改即可,重启mysql服务和CentOS/REHL上一致;


相关博文:

发表新评论