[root@node mariadb]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e9b8757eaaf6 mariadb:latest "docker-entrypoint.s…"36 seconds ago Up 35 seconds 0.0.0.0:3548->3306/tcp, :::3548->3306/tcp my-mariadb
六、查看mariadb容器运行日志
[root@node mariadb]# docker logs my-mariadb 2022-11-04 03:56:12+00:00 [Note][Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.5+maria~focal started.
2022-11-04 03:56:12+00:00 [Note][Entrypoint]: Switching to dedicated user 'mysql'2022-11-04 03:56:12+00:00 [Note][Entrypoint]: Entrypoint script for MariaDB Server 1:10.6.5+maria~focal started.
2022-11-04 3:56:12 0[Note] mariadbd (server 10.6.5-MariaDB-1:10.6.5+maria~focal) starting as process 1...
2022-11-04 3:56:12 0[Note] InnoDB: Compressed tables use zlib 1.2.11
2022-11-04 3:56:12 0[Note] InnoDB: Number of pools: 12022-11-04 3:56:12 0[Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-11-04 3:56:12 0[Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)2022-11-04 3:56:12 0[Note] InnoDB: Using Linux native AIO
2022-11-04 3:56:12 0[Note] InnoDB: Initializing buffer pool, total size =134217728, chunk size =1342177282022-11-04 3:56:12 0[Note] InnoDB: Completed initialization of buffer pool
2022-11-04 3:56:12 0[Note] InnoDB: 128 rollback segments are active.
2022-11-04 3:56:12 0[Note] InnoDB: Creating shared tablespace for temporary tables
2022-11-04 3:56:12 0[Note] InnoDB: Setting file'./ibtmp1' size to 12 MB. Physically writing the file full; Please wait...
2022-11-04 3:56:12 0[Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-11-04 3:56:12 0[Note] InnoDB: 10.6.5 started; log sequence number 42335; transaction id142022-11-04 3:56:12 0[Note] Plugin 'FEEDBACK' is disabled.
2022-11-04 3:56:12 0[Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-11-04 3:56:12 0[Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2022-11-04 3:56:12 0[Note] Server socket created on IP: '0.0.0.0'.2022-11-04 3:56:12 0[Note] Server socket created on IP: '::'.2022-11-04 3:56:12 0[Note] InnoDB: Buffer pool(s) load completed at 2211043:56:12
2022-11-04 3:56:12 0[Warning]'proxies_priv' entry '@% root@ac860c2aa163' ignored in --skip-name-resolve mode.
2022-11-04 3:56:12 0[Note] mariadbd: ready for connections.
Version: '10.6.5-MariaDB-1:10.6.5+maria~focal' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
七、测试访问mariadb
[root@node mariadb]# mysql -h 192.168.3.166 -P3548 -uroot -padmin
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.6.5-MariaDB-1:10.6.5+maria~focal mariadb.org binary distribution
Copyright (c)2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema || mysql || performance_schema || sys |
+--------------------+
4 rows inset(0.00 sec)
MariaDB [(none)]>