我想在我的 chromebook mariadb 中下载,我正在使用 archlinux,但安装后遇到此错误
Posted
技术标签:
【中文标题】我想在我的 chromebook mariadb 中下载,我正在使用 archlinux,但安装后遇到此错误【英文标题】:i am tring to download in my chromebook mariadb and i am using archlinux but facing this error after installing 【发布时间】:2022-01-16 05:10:46 【问题描述】:sudo systemctl start mysql
出现此错误
mariadb.service 的作业失败,因为控制进程以错误代码退出。 详见“systemctl status mariadb.service”和“journalctl -xeu mariadb.service”。
x mariadb.service - MariaDB 10.6.5 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Drop-In: /run/systemd/system/service.d
`-zzz-lxc-service.conf
Active: failed (Result: exit-code) since Sun 2021-12-12 14:23:36 IST; 1h 52min ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 5842 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 5843 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-en>
Process: 5851 ExecStart=/usr/bin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Main PID: 5851 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Buffer pool(s) load completed at 211212 14:23:36
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] Server socket created on IP: '0.0.0.0'.
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] Server socket created on IP: '::'.
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.db' doesn't exist
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [ERROR] Aborting
Dec 12 14:23:36 penguin mariadbd[5851]: Warning: Memory not freed: 280
Dec 12 14:23:36 penguin systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Dec 12 14:23:36 penguin systemd[1]: mariadb.service: Failed with result 'exit-code'.
Dec 12 14:23:36 penguin systemd[1]: Failed to start MariaDB 10.6.5 database server.
...skipping...
x mariadb.service - MariaDB 10.6.5 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Drop-In: /run/systemd/system/service.d
`-zzz-lxc-service.conf
Active: failed (Result: exit-code) since Sun 2021-12-12 14:23:36 IST; 1h 52min ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 5842 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 5843 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-en>
Process: 5851 ExecStart=/usr/bin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Main PID: 5851 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Buffer pool(s) load completed at 211212 14:23:36
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] Server socket created on IP: '0.0.0.0'.
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] Server socket created on IP: '::'.
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.db' doesn't exist
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [ERROR] Aborting
Dec 12 14:23:36 penguin mariadbd[5851]: Warning: Memory not freed: 280
Dec 12 14:23:36 penguin systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Dec 12 14:23:36 penguin systemd[1]: mariadb.service: Failed with result 'exit-code'.
Dec 12 14:23:36 penguin systemd[1]: Failed to start MariaDB 10.6.5 database server.
[harshpatel990@penguin ~]$ journalctl -xeu mariadb.service
-- The job identifier is 688 and the job result is failed.
Dec 12 13:54:05 penguin systemd[1]: Starting MariaDB 10.6.5 database server...
-- Subject: A start job for unit mariadb.service has begun execution
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit mariadb.service has begun execution.
--
-- The job identifier is 737.
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] /usr/bin/mariadbd (server 10.6.5-MariaDB) starting as process 5780 ...
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: Number of pools: 1
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: Using Linux native AIO
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: Completed initialization of buffer pool
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: 128 rollback segments are active.
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: Creating shared tablespace for temporary tables
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: 10.6.5 started; log sequence number 33062; transaction id 4
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not load>
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] InnoDB: Buffer pool(s) load completed at 211212 13:54:06
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] Server socket created on IP: '0.0.0.0'.
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [Note] Server socket created on IP: '::'.
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.db' doesn't exist
Dec 12 13:54:06 penguin mariadbd[5780]: 2021-12-12 13:54:06 0 [ERROR] Aborting
Dec 12 13:54:06 penguin mariadbd[5780]: Warning: Memory not freed: 280
Dec 12 13:54:06 penguin systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- An ExecStart= process belonging to unit mariadb.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Dec 12 13:54:06 penguin systemd[1]: mariadb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit mariadb.service has entered the 'failed' state with result 'exit-code'.
Dec 12 13:54:06 penguin systemd[1]: Failed to start MariaDB 10.6.5 database server.
-- Subject: A start job for unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit mariadb.service has finished with a failure.
--
-- The job identifier is 737 and the job result is failed.
Dec 12 14:23:35 penguin systemd[1]: Starting MariaDB 10.6.5 database server...
-- Subject: A start job for unit mariadb.service has begun execution
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit mariadb.service has begun execution.
--
-- The job identifier is 786.
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] /usr/bin/mariadbd (server 10.6.5-MariaDB) starting as process 5851 ...
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Number of pools: 1
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Using Linux native AIO
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Completed initialization of buffer pool
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: 128 rollback segments are active.
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Creating shared tablespace for temporary tables
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: 10.6.5 started; log sequence number 33074; transaction id 4
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not load>
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] InnoDB: Buffer pool(s) load completed at 211212 14:23:36
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] Server socket created on IP: '0.0.0.0'.
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [Note] Server socket created on IP: '::'.
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.db' doesn't exist
Dec 12 14:23:36 penguin mariadbd[5851]: 2021-12-12 14:23:36 0 [ERROR] Aborting
Dec 12 14:23:36 penguin mariadbd[5851]: Warning: Memory not freed: 280
Dec 12 14:23:36 penguin systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- An ExecStart= process belonging to unit mariadb.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Dec 12 14:23:36 penguin systemd[1]: mariadb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit mariadb.service has entered the 'failed' state with result 'exit-code'.
Dec 12 14:23:36 penguin systemd[1]: Failed to start MariaDB 10.6.5 database server.
-- Subject: A start job for unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- A start job for unit mariadb.service has finished with a failure.
--
-- The job identifier is 786 and the job result is failed.
以及何时尝试登录
mysql -u root -p
输入密码: 错误 2002 (HY000): 无法通过套接字'/run/mysqld/mysqld.sock' (111) 连接到本地服务器 [1]+ 退出 1 mysqld_safe --skip-grant-tables
【问题讨论】:
欢迎来到 Stack Overflow。您的第一条错误消息建议您查看几个系统状态项。请edit您的问题向我们展示他们所说的内容。而且,专业提示,请务必仔细阅读错误消息。 我现在看了 查看是否可以找到 MariaDB 错误日志文件(如果存在),因为它有时包含更多详细信息。它有时在您的数据目录中(在您的情况下为/var/lib/mysql/
)并且具有 .err 扩展名。您对 datadir 的所有权和权限是否正确?对于所有文件和子目录,用户和组应为 mysql
。用户应该对所有文件拥有“rw”权限,对所有子目录拥有“rwx”权限。你之前安装过 MySQL 吗?删除您的数据目录(除非您有重要数据)然后mariadb-install-db
重新安装一个新的、干净的数据目录可能会有所帮助。
如何清除datadir
【参考方案1】:
我认为你的路径(/var/lib/mysql)为空或配置错误。 尝试使用以下命令重新安装配置:
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
【讨论】:
以上是关于我想在我的 chromebook mariadb 中下载,我正在使用 archlinux,但安装后遇到此错误的主要内容,如果未能解决你的问题,请参考以下文章
通过 Android 应用程序的 Chromebook 规范