我正在尝试在 alpine:latest (asof 20231027; 20230901; 3.18.4) 容器上运行 mariadb。请原谅我是新手,但我一直在预装了它的主机系统上运行它。
我运行了 mysql_install_db
/var/log # mariadbd --user=root
2023-10-28 3:08:23 0 [Note] Starting MariaDB 10.11.5-MariaDB source revision 7875294b6b74b53dd3aaa723e6cc103d2bb47b2c as process 58
2023-10-28 3:08:23 0 [Note] InnoDB: The first data file './ibdata1' did not exist. A new tablespace will be created!
2023-10-28 3:08:23 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
2023-10-28 3:08:23 0 [Note] InnoDB: Number of transaction pools: 1
2023-10-28 3:08:23 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2023-10-28 3:08:23 0 [Note] mariadbd: O_TMPFILE is not supported on /var/tmp (disabling future attempts)
2023-10-28 3:08:23 0 [Note] InnoDB: Using Linux native AIO
2023-10-28 3:08:23 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2023-10-28 3:08:23 0 [Note] InnoDB: Completed initialization of buffer pool
2023-10-28 3:08:23 0 [Note] InnoDB: Setting file './ibdata1' size to 12.000MiB. Physically writing the file full; Please wait ...
2023-10-28 3:08:23 0 [Note] InnoDB: File './ibdata1' size is now 12.000MiB.
2023-10-28 3:08:23 0 [Note] InnoDB: Buffered log writes (block size=512 bytes)
2023-10-28 3:08:23 0 [Note] InnoDB: Doublewrite buffer not found: creating new
2023-10-28 3:08:23 0 [Note] InnoDB: 128 rollback segments are active.
2023-10-28 3:08:23 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2023-10-28 3:08:23 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2023-10-28 3:08:23 0 [Note] InnoDB: log sequence number 0; transaction id 3
2023-10-28 3:08:23 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-10-28 3:08:23 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2023-10-28 3:08:23 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
2023-10-28 3:08:23 0 [ERROR] Can't start server : Bind on unix socket: No such file or directory
2023-10-28 3:08:23 0 [ERROR] Do you already have another server running on socket: /run/mysqld/mysqld.sock ?
2023-10-28 3:08:23 0 [ERROR] Aborting
我要做什么才能让它正常运行?
答案1
您可能缺少/run/mysqld
容器中的目录。
在您的容器中,尝试:
# sudo mkdir /run/mysqld
如果这没有帮助:你需要找出 MariaDB 无法找到所需内容的原因。请参阅注释这里