从 AUR 存储库下载 MySQL 8.0.36 然后运行sudo systemctl start mysqld
(运行后sudo systemctl enable mysqld
)。但是,它给出了以下错误:
mysqld.service 的作业失败,因为控制进程退出并出现错误代码。有关详细信息,请参阅“systemctl status mysqld.service”和“journalctl -xeu mysqld.service”。
内容journalctl -xeu mysqld.service
:
-- Journal begins at Fri 2021-08-13 03:39:16 IST, ends at Mon 2021-09-20 16:06:37 IST. --
Sep 20 15:02:20 archlinux systemd[1]: Starting MySQL Server...
░░ Subject: A start job for unit mysqld.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit mysqld.service has begun execution.
░░
░░ The job identifier is 3035.
Sep 20 15:02:20 archlinux mysqld_pre_systemd[46389]: mktemp: failed to create file via template '/var/lib/mysql-files/install-validate-password-plugin.XXXXXX.sql': No such file or directory
Sep 20 15:02:20 archlinux mysqld_pre_systemd[46390]: chmod: cannot access '': No such file or directory
Sep 20 15:02:20 archlinux mysqld_pre_systemd[46388]: /usr/bin/mysqld_pre_systemd: line 43: : No such file or directory
Sep 20 15:02:20 archlinux mysqld_pre_systemd[46388]: /usr/bin/mysqld_pre_systemd: line 44: $initfile: ambiguous redirect
Sep 20 15:02:20 archlinux mysqld_pre_systemd[46391]: 2021-09-20T09:32:20.610211Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
Sep 20 15:02:20 archlinux mysqld_pre_systemd[46391]: 2021-09-20T09:32:20.610288Z 0 [System] [MY-013169] [Server] /usr/bin/mysqld (mysqld 8.0.26) initializing of server in progress as process 46391
Sep 20 15:02:20 archlinux mysqld_pre_systemd[46391]: 2021-09-20T09:32:20.641296Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
Sep 20 15:02:34 archlinux mysqld_pre_systemd[46391]: 2021-09-20T09:32:34.012850Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
Sep 20 15:03:09 archlinux mysqld_pre_systemd[46391]: 2021-09-20T09:33:09.683021Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
Sep 20 15:03:09 archlinux mysqld_pre_systemd[46391]: 2021-09-20T09:33:09.683407Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
Sep 20 15:03:09 archlinux mysqld_pre_systemd[46391]: 2021-09-20T09:33:09.781991Z 0 [ERROR] [MY-010455] [Server] Failed to open the bootstrap file (null)
Sep 20 15:03:09 archlinux mysqld_pre_systemd[46391]: 2021-09-20T09:33:09.782008Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
Sep 20 15:03:09 archlinux mysqld_pre_systemd[46391]: 2021-09-20T09:33:09.782034Z 0 [ERROR] [MY-010119] [Server] Aborting
Sep 20 15:03:27 archlinux mysqld_pre_systemd[46391]: 2021-09-20T09:33:27.728729Z 0 [System] [MY-010910] [Server] /usr/bin/mysqld: Shutdown complete (mysqld 8.0.26) Source distribution.
Sep 20 15:03:28 archlinux mysqld[46486]: 2021-09-20T09:33:28.102954Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
Sep 20 15:03:28 archlinux mysqld[46486]: 2021-09-20T09:33:28.103034Z 0 [System] [MY-010116] [Server] /usr/bin/mysqld (mysqld 8.0.26) starting as process 46486
Sep 20 15:03:28 archlinux mysqld[46486]: 2021-09-20T09:33:28.129728Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
Sep 20 15:03:29 archlinux mysqld[46486]: 2021-09-20T09:33:29.170005Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
Sep 20 15:03:29 archlinux mysqld[46486]: mysqld: Table 'mysql.plugin' doesn't exist
Sep 20 15:03:29 archlinux mysqld[46486]: 2021-09-20T09:33:29.385429Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
Sep 20 15:03:29 archlinux mysqld[46486]: 2021-09-20T09:33:29.386859Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:03:29 archlinux mysqld[46486]: 2021-09-20T09:33:29.387861Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:03:29 archlinux mysqld[46486]: 2021-09-20T09:33:29.388740Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:03:29 archlinux mysqld[46486]: 2021-09-20T09:33:29.389869Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:03:29 archlinux mysqld[46486]: 2021-09-20T09:33:29.390711Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:03:29 archlinux mysqld[46486]: 2021-09-20T09:33:29.391554Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:03:29 archlinux mysqld[46486]: 2021-09-20T09:33:29.392562Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:03:29 archlinux mysqld[46486]: 2021-09-20T09:33:29.780759Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
Sep 20 15:03:30 archlinux mysqld[46486]: 2021-09-20T09:33:30.017576Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
Sep 20 15:03:30 archlinux mysqld[46486]: 2021-09-20T09:33:30.049664Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
Sep 20 15:03:30 archlinux mysqld[46486]: 2021-09-20T09:33:30.050224Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
Sep 20 15:03:30 archlinux mysqld[46486]: 2021-09-20T09:33:30.053313Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
Sep 20 15:03:30 archlinux mysqld[46486]: 2021-09-20T09:33:30.054132Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
Sep 20 15:03:30 archlinux mysqld[46486]: 2021-09-20T09:33:30.059712Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:03:30 archlinux mysqld[46486]: 2021-09-20T09:33:30.060885Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist
Sep 20 15:03:30 archlinux mysqld[46486]: 2021-09-20T09:33:30.061569Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition.
Sep 20 15:03:30 archlinux mysqld[46486]: 2021-09-20T09:33:30.063609Z 0 [ERROR] [MY-010326] [Server] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
Sep 20 15:03:30 archlinux mysqld[46486]: 2021-09-20T09:33:30.064458Z 0 [ERROR] [MY-010952] [Server] The privilege system failed to initialize correctly. For complete instructions on how to upgrade MySQL to a new version please see the 'Upgrading MySQL' section from the MySQL manual.
Sep 20 15:03:30 archlinux mysqld[46486]: 2021-09-20T09:33:30.066133Z 0 [ERROR] [MY-010119] [Server] Aborting
Sep 20 15:03:32 archlinux mysqld[46486]: 2021-09-20T09:33:32.332310Z 0 [System] [MY-010910] [Server] /usr/bin/mysqld: Shutdown complete (mysqld 8.0.26) Source distribution.
Sep 20 15:03:32 archlinux systemd[1]: mysqld.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 mysqld.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Sep 20 15:03:32 archlinux systemd[1]: mysqld.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit mysqld.service has entered the 'failed' state with result 'exit-code'.
Sep 20 15:03:32 archlinux systemd[1]: Failed to start MySQL Server.
░░ Subject: A start job for unit mysqld.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit mysqld.service has finished with a failure.
░░
░░ The job identifier is 3035 and the job result is failed.
Sep 20 15:03:32 archlinux systemd[1]: mysqld.service: Consumed 5.170s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit mysqld.service completed and consumed the indicated resources.
Sep 20 15:09:11 archlinux systemd[1]: Starting MySQL Server...
░░ Subject: A start job for unit mysqld.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit mysqld.service has begun execution.
░░
░░ The job identifier is 3201.
Sep 20 15:09:11 archlinux mysqld[47078]: 2021-09-20T09:39:11.388078Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
Sep 20 15:09:11 archlinux mysqld[47078]: 2021-09-20T09:39:11.388129Z 0 [System] [MY-010116] [Server] /usr/bin/mysqld (mysqld 8.0.26) starting as process 47078
Sep 20 15:09:11 archlinux mysqld[47078]: 2021-09-20T09:39:11.395117Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
Sep 20 15:09:12 archlinux mysqld[47078]: 2021-09-20T09:39:12.422857Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
Sep 20 15:09:12 archlinux mysqld[47078]: mysqld: Table 'mysql.plugin' doesn't exist
Sep 20 15:09:12 archlinux mysqld[47078]: 2021-09-20T09:39:12.658089Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
Sep 20 15:09:12 archlinux mysqld[47078]: 2021-09-20T09:39:12.659336Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:12 archlinux mysqld[47078]: 2021-09-20T09:39:12.660203Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:12 archlinux mysqld[47078]: 2021-09-20T09:39:12.661077Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:12 archlinux mysqld[47078]: 2021-09-20T09:39:12.662207Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:12 archlinux mysqld[47078]: 2021-09-20T09:39:12.663015Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:12 archlinux mysqld[47078]: 2021-09-20T09:39:12.663854Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:12 archlinux mysqld[47078]: 2021-09-20T09:39:12.664683Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:12 archlinux mysqld[47078]: 2021-09-20T09:39:12.827203Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
Sep 20 15:09:13 archlinux mysqld[47078]: 2021-09-20T09:39:13.164880Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
Sep 20 15:09:13 archlinux mysqld[47078]: 2021-09-20T09:39:13.197466Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
Sep 20 15:09:13 archlinux mysqld[47078]: 2021-09-20T09:39:13.198322Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
Sep 20 15:09:13 archlinux mysqld[47078]: 2021-09-20T09:39:13.201045Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
Sep 20 15:09:13 archlinux mysqld[47078]: 2021-09-20T09:39:13.201683Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
Sep 20 15:09:13 archlinux mysqld[47078]: 2021-09-20T09:39:13.207418Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:13 archlinux mysqld[47078]: 2021-09-20T09:39:13.208493Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist
Sep 20 15:09:13 archlinux mysqld[47078]: 2021-09-20T09:39:13.209144Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition.
Sep 20 15:09:13 archlinux mysqld[47078]: 2021-09-20T09:39:13.211124Z 0 [ERROR] [MY-010326] [Server] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
Sep 20 15:09:13 archlinux mysqld[47078]: 2021-09-20T09:39:13.211872Z 0 [ERROR] [MY-010952] [Server] The privilege system failed to initialize correctly. For complete instructions on how to upgrade MySQL to a new version please see the 'Upgrading MySQL' section from the MySQL manual.
Sep 20 15:09:13 archlinux mysqld[47078]: 2021-09-20T09:39:13.213634Z 0 [ERROR] [MY-010119] [Server] Aborting
Sep 20 15:09:15 archlinux mysqld[47078]: 2021-09-20T09:39:15.117539Z 0 [System] [MY-010910] [Server] /usr/bin/mysqld: Shutdown complete (mysqld 8.0.26) Source distribution.
Sep 20 15:09:15 archlinux systemd[1]: mysqld.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 mysqld.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Sep 20 15:09:15 archlinux systemd[1]: mysqld.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit mysqld.service has entered the 'failed' state with result 'exit-code'.
Sep 20 15:09:15 archlinux systemd[1]: Failed to start MySQL Server.
░░ Subject: A start job for unit mysqld.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit mysqld.service has finished with a failure.
░░
░░ The job identifier is 3201 and the job result is failed.
Sep 20 15:09:15 archlinux systemd[1]: mysqld.service: Consumed 1.235s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit mysqld.service completed and consumed the indicated resources.
Sep 20 15:09:49 archlinux systemd[1]: Starting MySQL Server...
░░ Subject: A start job for unit mysqld.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit mysqld.service has begun execution.
░░
░░ The job identifier is 3290.
Sep 20 15:09:50 archlinux mysqld[47207]: 2021-09-20T09:39:50.075264Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
Sep 20 15:09:50 archlinux mysqld[47207]: 2021-09-20T09:39:50.075348Z 0 [System] [MY-010116] [Server] /usr/bin/mysqld (mysqld 8.0.26) starting as process 47207
Sep 20 15:09:50 archlinux mysqld[47207]: 2021-09-20T09:39:50.152770Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.107623Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
Sep 20 15:09:55 archlinux mysqld[47207]: mysqld: Table 'mysql.plugin' doesn't exist
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.251280Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.251890Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.252313Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.252715Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.253229Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.253664Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.254124Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.254496Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.445838Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.686140Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.718563Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.719234Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.721865Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.722757Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.728447Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.729640Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.730413Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition.
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.732637Z 0 [ERROR] [MY-010326] [Server] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.733607Z 0 [ERROR] [MY-010952] [Server] The privilege system failed to initialize correctly. For complete instructions on how to upgrade MySQL to a new version please see the 'Upgrading MySQL' section from the MySQL manual.
Sep 20 15:09:55 archlinux mysqld[47207]: 2021-09-20T09:39:55.735486Z 0 [ERROR] [MY-010119] [Server] Aborting
Sep 20 15:09:57 archlinux mysqld[47207]: 2021-09-20T09:39:57.465393Z 0 [System] [MY-010910] [Server] /usr/bin/mysqld: Shutdown complete (mysqld 8.0.26) Source distribution.
Sep 20 15:09:57 archlinux systemd[1]: mysqld.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 mysqld.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Sep 20 15:09:57 archlinux systemd[1]: mysqld.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit mysqld.service has entered the 'failed' state with result 'exit-code'.
Sep 20 15:09:57 archlinux systemd[1]: Failed to start MySQL Server.
░░ Subject: A start job for unit mysqld.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit mysqld.service has finished with a failure.
░░
░░ The job identifier is 3290 and the job result is failed.
Sep 20 15:09:57 archlinux systemd[1]: mysqld.service: Consumed 1.169s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit mysqld.service completed and consumed the indicated resources.
答案1
这是我认为错误日志中的相关行:
Sep 20 15:03:09 archlinux mysqld_pre_systemd[46391]: 2021-09-20T09:33:09.782008Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
滚动显示“指定的数据目录/var/lib/mysql/
不可用”。
您是否已初始化mysqld
安装以便填充该文件夹?
如果不是:请查看并遵循,例如https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html
如果是:您是否尝试过恢复该文件夹(还要检查所有者/组/访问掩码),也许清空并重新初始化它(在此之前:停止守护程序并将文件移到其他地方,不要删除它们)?
这是文件夹本身在我的系统上的样子(来自非 arch 的示例,但应该是相同的):
# ls -ld /var/lib/mysql
drwxr-xr-x. 5 mysql mysql 4096 Sep 13 00:13 /var/lib/mysql
它在您的系统上看起来如何?有什么内容吗?