debian安装mariadb过程记录

root@bogon:~# apt update
忽略:1 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye InRelease
错误:2 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye Release
  请使用 apt-cdrom,通过它可以让 APT 识别该盘片。apt-get upgdate 不能被用来加入新的盘片。
命中:3 http://security.debian.org/debian-security bullseye-security InRelease
命中:4 http://mirrors.163.com/debian bullseye InRelease
命中:5 http://mirrors.163.com/debian bullseye-updates InRelease
正在读取软件包列表... 完成
E: 仓库 “cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@bogon:~# apt install mariadb-server
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
将会同时安装下列软件:
  galera-4 gawk libaio1 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mariadb-perl libdbi-perl libfcgi-bin libfcgi-perl
  libfcgi0ldbl libhtml-template-perl libmariadb3 libsigsegv2 libterm-readkey-perl mariadb-client-10.5 mariadb-client-core-10.5 mariadb-common
  mariadb-server-10.5 mariadb-server-core-10.5 mysql-common rsync socat
建议安装:
  gawk-doc libmldbm-perl libnet-daemon-perl libsql-statement-perl libipc-sharedcache-perl mailx mariadb-test netcat-openbsd
下列【新】软件包将被安装:
  galera-4 gawk libaio1 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mariadb-perl libdbi-perl libfcgi-bin libfcgi-perl
  libfcgi0ldbl libhtml-template-perl libmariadb3 libsigsegv2 libterm-readkey-perl mariadb-client-10.5 mariadb-client-core-10.5 mariadb-common
  mariadb-server mariadb-server-10.5 mariadb-server-core-10.5 mysql-common rsync socat
升级了 0 个软件包,新安装了 24 个软件包,要卸载 0 个软件包,有 159 个软件包未被升级。
需要下载 15.1 MB/17.4 MB 的归档。
解压缩后会消耗 159 MB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://security.debian.org/debian-security bullseye-security/main amd64 mariadb-common all 1:10.5.26-0+deb11u2 [37.5 kB]
获取:2 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 libsigsegv2 amd64 2.13-1 [34.8 kB]
获取:3 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 gawk amd64 1:5.1.0-1 [605 kB]
获取:4 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 mysql-common all 5.8+1.0.7 [7,464 B]
获取:5 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 libdbi-perl amd64 1.643-3+b1 [780 kB]
获取:6 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 libconfig-inifiles-perl all 3.000003-1 [52.1 kB]
获取:7 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 libaio1 amd64 0.3.112-9 [12.5 kB]
获取:8 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 socat amd64 1.7.4.1-3 [370 kB]
获取:9 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 libcgi-pm-perl all 4.51-1 [224 kB]
获取:10 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 libfcgi0ldbl amd64 2.4.2-2 [26.1 kB]
获取:11 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 libfcgi-perl amd64 0.79+ds-2 [27.6 kB]
获取:12 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 libcgi-fast-perl all 1:2.15-1 [12.1 kB]
获取:13 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 libhtml-template-perl all 2.97-1.1 [66.2 kB]
获取:14 cdrom://[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 DVD Binary-1 20210814-10:04] bullseye/main amd64 libterm-readkey-perl amd64 2.38-1+b2 [27.8 kB]
获取:15 http://security.debian.org/debian-security bullseye-security/main amd64 galera-4 amd64 26.4.20-0+deb11u1 [820 kB]
获取:16 http://security.debian.org/debian-security bullseye-security/main amd64 libmariadb3 amd64 1:10.5.26-0+deb11u2 [177 kB]
获取:17 http://security.debian.org/debian-security bullseye-security/main amd64 mariadb-client-core-10.5 amd64 1:10.5.26-0+deb11u2 [786 kB]
获取:18 http://security.debian.org/debian-security bullseye-security/main amd64 mariadb-client-10.5 amd64 1:10.5.26-0+deb11u2 [1,511 kB]
获取:19 http://mirrors.163.com/debian bullseye/main amd64 rsync amd64 3.2.3-4+deb11u1 [396 kB]
获取:20 http://mirrors.163.com/debian bullseye/main amd64 libdbd-mariadb-perl amd64 1.21-3 [110 kB]
获取:21 http://mirrors.163.com/debian bullseye/main amd64 libfcgi-bin amd64 2.4.2-2 [12.9 kB]
获取:22 http://security.debian.org/debian-security bullseye-security/main amd64 mariadb-server-core-10.5 amd64 1:10.5.26-0+deb11u2 [6,940 kB]
获取:23 http://security.debian.org/debian-security bullseye-security/main amd64 mariadb-server-10.5 amd64 1:10.5.26-0+deb11u2 [4,303 kB]
获取:24 http://security.debian.org/debian-security bullseye-security/main amd64 mariadb-server all 1:10.5.26-0+deb11u2 [36.0 kB]
已下载 15.1 MB,耗时 1分 29秒 (170 kB/s)
正在预设定软件包 ...
正在选中未选择的软件包 libsigsegv2:amd64。
(正在读取数据库 ... 系统当前共安装有 153432 个文件和目录。)
准备解压 .../libsigsegv2_2.13-1_amd64.deb  ...
正在解压 libsigsegv2:amd64 (2.13-1) ...
正在设置 libsigsegv2:amd64 (2.13-1) ...
正在选中未选择的软件包 gawk。
(正在读取数据库 ... 系统当前共安装有 153441 个文件和目录。)
准备解压 .../00-gawk_5.1.0-1_amd64.deb  ...
正在解压 gawk (1:5.1.0-1) ...
正在选中未选择的软件包 mysql-common。
准备解压 .../01-mysql-common_5.8+1.0.7_all.deb  ...
正在解压 mysql-common (5.8+1.0.7) ...
正在选中未选择的软件包 mariadb-common。
准备解压 .../02-mariadb-common_1%3a10.5.26-0+deb11u2_all.deb  ...
正在解压 mariadb-common (1:10.5.26-0+deb11u2) ...
正在选中未选择的软件包 galera-4。
准备解压 .../03-galera-4_26.4.20-0+deb11u1_amd64.deb  ...
正在解压 galera-4 (26.4.20-0+deb11u1) ...
正在选中未选择的软件包 libdbi-perl:amd64。
准备解压 .../04-libdbi-perl_1.643-3+b1_amd64.deb  ...
正在解压 libdbi-perl:amd64 (1.643-3+b1) ...
正在选中未选择的软件包 libconfig-inifiles-perl。
准备解压 .../05-libconfig-inifiles-perl_3.000003-1_all.deb  ...
正在解压 libconfig-inifiles-perl (3.000003-1) ...
正在选中未选择的软件包 libmariadb3:amd64。
准备解压 .../06-libmariadb3_1%3a10.5.26-0+deb11u2_amd64.deb  ...
正在解压 libmariadb3:amd64 (1:10.5.26-0+deb11u2) ...
正在选中未选择的软件包 mariadb-client-core-10.5。
准备解压 .../07-mariadb-client-core-10.5_1%3a10.5.26-0+deb11u2_amd64.deb  ...
正在解压 mariadb-client-core-10.5 (1:10.5.26-0+deb11u2) ...
正在选中未选择的软件包 mariadb-client-10.5。
准备解压 .../08-mariadb-client-10.5_1%3a10.5.26-0+deb11u2_amd64.deb  ...
正在解压 mariadb-client-10.5 (1:10.5.26-0+deb11u2) ...
正在选中未选择的软件包 libaio1:amd64。
准备解压 .../09-libaio1_0.3.112-9_amd64.deb  ...
正在解压 libaio1:amd64 (0.3.112-9) ...
正在选中未选择的软件包 mariadb-server-core-10.5。
准备解压 .../10-mariadb-server-core-10.5_1%3a10.5.26-0+deb11u2_amd64.deb  ...
正在解压 mariadb-server-core-10.5 (1:10.5.26-0+deb11u2) ...
正在选中未选择的软件包 rsync。
准备解压 .../11-rsync_3.2.3-4+deb11u1_amd64.deb  ...
正在解压 rsync (3.2.3-4+deb11u1) ...
正在选中未选择的软件包 socat。
准备解压 .../12-socat_1.7.4.1-3_amd64.deb  ...
正在解压 socat (1.7.4.1-3) ...
正在设置 mysql-common (5.8+1.0.7) ...
update-alternatives: 使用 /etc/mysql/my.cnf.fallback 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)
正在设置 mariadb-common (1:10.5.26-0+deb11u2) ...
update-alternatives: 使用 /etc/mysql/mariadb.cnf 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)
正在选中未选择的软件包 mariadb-server-10.5。
(正在读取数据库 ... 系统当前共安装有 154093 个文件和目录。)
准备解压 .../0-mariadb-server-10.5_1%3a10.5.26-0+deb11u2_amd64.deb  ...
正在解压 mariadb-server-10.5 (1:10.5.26-0+deb11u2) ...
正在选中未选择的软件包 libcgi-pm-perl。
准备解压 .../1-libcgi-pm-perl_4.51-1_all.deb  ...
正在解压 libcgi-pm-perl (4.51-1) ...
正在选中未选择的软件包 libfcgi0ldbl:amd64。
准备解压 .../2-libfcgi0ldbl_2.4.2-2_amd64.deb  ...
正在解压 libfcgi0ldbl:amd64 (2.4.2-2) ...
正在选中未选择的软件包 libfcgi-perl:amd64。
准备解压 .../3-libfcgi-perl_0.79+ds-2_amd64.deb  ...
正在解压 libfcgi-perl:amd64 (0.79+ds-2) ...
正在选中未选择的软件包 libcgi-fast-perl。
准备解压 .../4-libcgi-fast-perl_2.15-1_all.deb  ...
正在解压 libcgi-fast-perl (1:2.15-1) ...
正在选中未选择的软件包 libdbd-mariadb-perl。
准备解压 .../5-libdbd-mariadb-perl_1.21-3_amd64.deb  ...
正在解压 libdbd-mariadb-perl (1.21-3) ...
正在选中未选择的软件包 libfcgi-bin。
准备解压 .../6-libfcgi-bin_2.4.2-2_amd64.deb  ...
正在解压 libfcgi-bin (2.4.2-2) ...
正在选中未选择的软件包 libhtml-template-perl。
准备解压 .../7-libhtml-template-perl_2.97-1.1_all.deb  ...
正在解压 libhtml-template-perl (2.97-1.1) ...
正在选中未选择的软件包 libterm-readkey-perl。
准备解压 .../8-libterm-readkey-perl_2.38-1+b2_amd64.deb  ...
正在解压 libterm-readkey-perl (2.38-1+b2) ...
正在选中未选择的软件包 mariadb-server。
准备解压 .../9-mariadb-server_1%3a10.5.26-0+deb11u2_all.deb  ...
正在解压 mariadb-server (1:10.5.26-0+deb11u2) ...
正在设置 libconfig-inifiles-perl (3.000003-1) ...
正在设置 galera-4 (26.4.20-0+deb11u1) ...
正在设置 libfcgi0ldbl:amd64 (2.4.2-2) ...
正在设置 gawk (1:5.1.0-1) ...
正在设置 libcgi-pm-perl (4.51-1) ...
正在设置 libfcgi-bin (2.4.2-2) ...
正在设置 libhtml-template-perl (2.97-1.1) ...
正在设置 socat (1.7.4.1-3) ...
正在设置 libmariadb3:amd64 (1:10.5.26-0+deb11u2) ...
正在设置 libfcgi-perl:amd64 (0.79+ds-2) ...
正在设置 libterm-readkey-perl (2.38-1+b2) ...
正在设置 libaio1:amd64 (0.3.112-9) ...
正在设置 libdbi-perl:amd64 (1.643-3+b1) ...
正在设置 rsync (3.2.3-4+deb11u1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/rsync.service → /lib/systemd/system/rsync.service.
正在设置 mariadb-server-core-10.5 (1:10.5.26-0+deb11u2) ...
正在设置 libcgi-fast-perl (1:2.15-1) ...
正在设置 libdbd-mariadb-perl (1.21-3) ...
正在设置 mariadb-client-core-10.5 (1:10.5.26-0+deb11u2) ...
正在设置 mariadb-client-10.5 (1:10.5.26-0+deb11u2) ...
正在设置 mariadb-server-10.5 (1:10.5.26-0+deb11u2) ...
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /lib/systemd/system/mariadb.service.
正在设置 mariadb-server (1:10.5.26-0+deb11u2) ...
正在处理用于 man-db (2.9.4-2) 的触发器 ...
正在处理用于 libc-bin (2.31-13+deb11u8) 的触发器 ...
root@bogon:~#
root@bogon:~# systemctl status mariadb
● mariadb.service - MariaDB 10.5.26 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor prese>
     Active: active (running) since Fri 2024-11-22 21:42:05 CST; 7min ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 5088 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var>
    Process: 5089 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_ST>
    Process: 5091 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && >
    Process: 5163 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_S>
    Process: 5165 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/>
   Main PID: 5144 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 8 (limit: 37641)
     Memory: 71.7M
        CPU: 906ms
     CGroup: /system.slice/mariadb.service
             └─5144 /usr/sbin/mariadbd

11月 22 21:42:05 bogon mariadbd[5144]: 2024-11-22 21:42:05 0 [Note] InnoDB: 10.>
11月 22 21:42:05 bogon mariadbd[5144]: 2024-11-22 21:42:05 0 [Note] InnoDB: Loa>
11月 22 21:42:05 bogon mariadbd[5144]: 2024-11-22 21:42:05 0 [Note] Plugin 'FEE>
11月 22 21:42:05 bogon mariadbd[5144]: 2024-11-22 21:42:05 0 [Note] InnoDB: Buf>
11月 22 21:42:05 bogon mariadbd[5144]: 2024-11-22 21:42:05 0 [Note] Server sock>
11月 22 21:42:05 bogon mariadbd[5144]: 2024-11-22 21:42:05 0 [Note] Reading of >
11月 22 21:42:05 bogon mariadbd[5144]: 2024-11-22 21:42:05 0 [Note] Added new M>
11月 22 21:42:05 bogon mariadbd[5144]: 2024-11-22 21:42:05 0 [Note] /usr/sbin/m>
11月 22 21:42:05 bogon mariadbd[5144]: Version: '10.5.26-MariaDB-0+deb11u2'  so>
11月 22 21:42:05 bogon systemd[1]: Started MariaDB 10.5.26 database server.

root@bogon:~# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] Y
Enabled successfully!
Reloading privilege tables..
 ... Success!


You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
root@bogon:~#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值