Я застрял на этом несколько дней. Когда я запускаю сервис mysql start
он возвращает следующее:
matthew@matthewserver:~$ service mysql start
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'mysql.service'.
Authenticating as: matthew tranmer (matthew)
Password:
==== AUTHENTICATION COMPLETE ===
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
Когда я запускаю journalctl -xe
:
-- Unit mysql.service has begun starting up.
Oct 02 16:32:27 matthewserver mysql-systemd-start[31599]: ERROR: Unable to start MySQL server:
Oct 02 16:32:27 matthewserver mysql-systemd-start[31599]: 2018-10-02T16:32:27.849609Z 0 [ERROR] unknown variable 'key_buffer=16M'
Oct 02 16:32:27 matthewserver mysql-systemd-start[31599]: 2018-10-02T16:32:27.857580Z 0 [ERROR] Aborting
Oct 02 16:32:27 matthewserver mysql-systemd-start[31599]: Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.
Oct 02 16:32:27 matthewserver mysql-systemd-start[31599]: Once the problem is resolved, restart the service.
Oct 02 16:32:27 matthewserver systemd[1]: mysql.service: Control process exited, code=exited status=1
Oct 02 16:32:27 matthewserver systemd[1]: mysql.service: Failed with result 'exit-code'.
Oct 02 16:32:27 matthewserver systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has failed.
--
-- The result is RESULT.
Oct 02 16:32:28 matthewserver systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Oct 02 16:32:28 matthewserver systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit mysql.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Oct 02 16:32:28 matthewserver systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has finished shutting down.
Oct 02 16:32:28 matthewserver systemd[1]: mysql.service: Start request repeated too quickly.
Oct 02 16:32:28 matthewserver systemd[1]: mysql.service: Failed with result 'exit-code'.
Oct 02 16:32:28 matthewserver systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has failed.
--
-- The result is RESULT.
и когда я запускаю systemctl status mysql.service
, я получаю:
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2018-10-02 16:32:28 UTC; 2min 33s ago
Process: 28760 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
Process: 31599 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
Oct 02 16:32:27 matthewserver mysql-systemd-start[31599]: Once the problem is resolved, restart the service.
Oct 02 16:32:27 matthewserver systemd[1]: mysql.service: Control process exited, code=exited status=1
Oct 02 16:32:27 matthewserver systemd[1]: mysql.service: Failed with result 'exit-code'.
Oct 02 16:32:27 matthewserver systemd[1]: Failed to start MySQL Community Server.
Oct 02 16:32:28 matthewserver systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Oct 02 16:32:28 matthewserver systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Oct 02 16:32:28 matthewserver systemd[1]: Stopped MySQL Community Server.
Oct 02 16:32:28 matthewserver systemd[1]: mysql.service: Start request repeated too quickly.
Oct 02 16:32:28 matthewserver systemd[1]: mysql.service: Failed with result 'exit-code'.
Oct 02 16:32:28 matthewserver systemd[1]: Failed to start MySQL Community Server.
Это происходит, когда Я запускаю sudo mysql
matthew@matthewserver:~$ sudo mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Я не знаю, что делать, чтобы заставить его работать, это своего рода крайняя мера.
У вас ошибка в конфигурации mysqld:
02 октября 16:32:27 matthewserver mysql-systemd-start [31599]: 2018-10-02T16: 32: 27.849609Z 0 [ ОШИБКА] неизвестная переменная 'key_buffer = 16M'
Вы должны использовать key_buffer_size = 16M
, а не key_buffer = 16M
Есть строка в вывод journalctl:
2018-10-02T16: 32: 27.849609Z 0 [ERROR] неизвестная переменная 'key_buffer = 16M'
Эта системная переменная не существует. Возможно, вы пытаетесь установить переменную key_buffer_size
. В файле my.cnf
, который обычно находится в / etc
, удалите запись key_buffer
и добавьте следующую:
key_buffer_size = 16M