Версия Ubuntu:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
У меня проблемы с запуском mysql, всегда, когда я пытаюсь, появляется следующий сообщение:
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
Я попытался проверить mysqld.log
с помощью команды tail -f /var/log/mysqld.log
, но, похоже, его нет.
Я попытался проверить с помощью systemctl status mysql.service
и получил следующее:
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-06-07 11:56:52 -03; 5h 18min ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 8885 ExecStartPre=/usr/share/mysql-8.0/mysql-systemd-start pre (code=exited, status=1/FAILURE)
jun 07 11:56:52 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
jun 07 11:56:52 mauriciojr27-Inspiron-3442 systemd[1]: Stopped MySQL Community Server.
jun 07 11:56:52 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Start request repeated too quickly.
jun 07 11:56:52 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Failed with result 'exit-code'.
jun 07 11:56:52 mauriciojr27-Inspiron-3442 systemd[1]: Failed to start MySQL Community Server.
Мой файл mysql.cnf
настроен следующим образом:
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
#
# IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
Далее я попытался установить и после удаления репозитория MySQL APT, но появляется это сообщение:
Error while installing package: the subprocess installed, package mysql-common, script post-installation return the error status exit 2
Вывод команды sudo journalctl -u mysql.service -n 100
:
-- Logs begin at Sat 2021-01-09 07:11:57 -03, end at Mon 2021-06-07 17:52:46 -03. --
jun 07 10:37:25 mauriciojr27-Inspiron-3442 systemd[1]: Starting MySQL Community Server...
jun 07 10:37:25 mauriciojr27-Inspiron-3442 mysql-systemd-start[73897]: MySQL configuration not found at /etc/mysql/my.cnf>
jun 07 10:37:25 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILU>
jun 07 10:37:25 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Failed with result 'exit-code'.
jun 07 10:37:25 mauriciojr27-Inspiron-3442 systemd[1]: Failed to start MySQL Community Server.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 3.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: Stopped MySQL Community Server.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: Starting MySQL Community Server...
jun 07 10:37:26 mauriciojr27-Inspiron-3442 mysql-systemd-start[73936]: MySQL configuration not found at /etc/mysql/my.cnf>
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILU>
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Failed with result 'exit-code'.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: Failed to start MySQL Community Server.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 4.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: Stopped MySQL Community Server.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: Starting MySQL Community Server...
jun 07 10:37:26 mauriciojr27-Inspiron-3442 mysql-systemd-start[73975]: MySQL configuration not found at /etc/mysql/my.cnf>
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILU>
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Failed with result 'exit-code'.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: Failed to start MySQL Community Server.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: Stopped MySQL Community Server.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Start request repeated too quickly.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: mysql.service: Failed with result 'exit-code'.
jun 07 10:37:26 mauriciojr27-Inspiron-3442 systemd[1]: Failed to start MySQL Community Server.
-- Reboot --
jun 07 11:56:50 mauriciojr27-Inspiron-3442 systemd[1]: Starting MySQL Community Server...
Команда sudo tail -f / var / log / mysql / error.log
ничего не возвращает
Как я могу это исправить?
Ошибка четко указана в выходных данных:
jun 07 10:37:25 mauriciojr27-Inspiron-3442 mysql-systemd-start[73897]: MySQL configuration not found at /etc/mysql/my.cnf>
Ваша система пытается использовать my.cnf
, и вы предоставили mysql.cnf
.
Попробуйте скопировать mysql.cnf
в my.cnf
и перезагрузите компьютер.