MySQL сервер сообщества, не запущенный в ubuntu 18.04

Whenever I run 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 Wed 2020-10-07 22:36:27 UTC; 17s ago
    Process: 7996 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)

    Oct 07 22:36:27 ns5002486 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
    Oct 07 22:36:27 ns5002486 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
    Oct 07 22:36:27 ns5002486 systemd[1]: Stopped MySQL Community Server.
    Oct 07 22:36:27 ns5002486 systemd[1]: mysql.service: Start request repeated too quickly.
    Oct 07 22:36:27 ns5002486 systemd[1]: mysql.service: Failed with result 'exit-code'.
    Oct 07 22:36:27 ns5002486 systemd[1]: Failed to start MySQL Community Server.

Это результат journalctl -xe -u mysql.service:

    Oct 07 22:36:27 ns5002486 systemd[1]: mysql.service: Scheduled restart job, rest
    -- 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 res
    -- the configured Restart= setting for the unit.
    Oct 07 22:36:27 ns5002486 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 07 22:36:27 ns5002486 systemd[1]: mysql.service: Start request repeated too
    Oct 07 22:36:27 ns5002486 systemd[1]: mysql.service: Failed with result 'exit-co
    Oct 07 22:36:27 ns5002486 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.
    lines 359-381/381 (END)
    Oct 07 22:36:27 ns5002486 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 07 22:36:27 ns5002486 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 07 22:36:27 ns5002486 systemd[1]: mysql.service: Start request repeated too quickly.
    Oct 07 22:36:27 ns5002486 systemd[1]: mysql.service: Failed with result 'exit-code'.
    Oct 07 22:36:27 ns5002486 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.

Результат systemctl start mysql.service и journalctl -xe

    Job for mysql.service failed because the control process exited with error code.
    See "systemctl status mysql.service" and "journalctl -xe" for details.
    root@ns5002486:~# journalctl -xe
    -- Support: http://www.ubuntu.com/support
    --
    -- Unit mysql.service has begun starting up.
    Oct 11 03:04:30 ns5002486 mysql-systemd-start[32163]: ERROR: Unable to start MySQL server:
    Oct 11 03:04:30 ns5002486 mysql-systemd-start[32163]: mysqld: Error on realpath() on '/var/lib/mysql-files' (Error 2 - No such file or directory)
    Oct 11 03:04:30 ns5002486 mysql-systemd-start[32163]: 2020-10-11T03:04:30.983966Z 0 [ERROR] Failed to access directory for --secure-file-priv. 
    Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /va
    Oct 11 03:04:30 ns5002486 mysql-systemd-start[32163]: 2020-10-11T03:04:30.986263Z 0 [ERROR] Aborting
    Oct 11 03:04:30 ns5002486 mysql-systemd-start[32163]: Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.
    Oct 11 03:04:30 ns5002486 mysql-systemd-start[32163]: Once the problem is resolved, restart the service.
    Oct 11 03:04:30 ns5002486 systemd[1]: mysql.service: Control process exited, code=exited status=1
    Oct 11 03:04:30 ns5002486 systemd[1]: mysql.service: Failed with result 'exit-code'.
    Oct 11 03:04:30 ns5002486 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 11 03:04:31 ns5002486 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
    Oct 11 03:04:31 ns5002486 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 11 03:04:31 ns5002486 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 11 03:04:31 ns5002486 systemd[1]: mysql.service: Start request repeated too quickly.
    Oct 11 03:04:31 ns5002486 systemd[1]: mysql.service: Failed with result 'exit-code'.
    Oct 11 03:04:31 ns5002486 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 11 03:04:31 ns5002486 sshd[32045]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.186.31.83  user=root
    Oct 11 03:04:32 ns5002486 sshd[32134]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=218.92.0.208  user=root
    Oct 11 03:04:34 ns5002486 sshd[32045]: Failed password for root from 222.186.31.83 port 35207 ssh2
    Oct 11 03:04:34 ns5002486 sshd[32134]: Failed password for root from 218.92.0.208 port 42769 ssh2
    Oct 11 03:04:36 ns5002486 sshd[32189]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=218.92.0.208  user=root
    Oct 11 03:04:36 ns5002486 sshd[32045]: Failed password for root from 222.186.31.83 port 35207 ssh2
    Oct 11 03:04:36 ns5002486 sshd[32134]: Failed password for root from 218.92.0.208 port 42769 ssh2
    Oct 11 03:04:38 ns5002486 sshd[32189]: Failed password for root from 218.92.0.208 port 52261 ssh2
    Oct 11 03:04:39 ns5002486 sshd[32045]: Failed password for root from 222.186.31.83 port 35207 ssh2
    Oct 11 03:04:39 ns5002486 sshd[32134]: Failed password for root from 218.92.0.208 port 42769 ssh2
    Oct 11 03:04:39 ns5002486 sshd[32045]: Received disconnect from 222.186.31.83 port 35207:11:  [preauth]
    Oct 11 03:04:39 ns5002486 sshd[32045]: Disconnected from authenticating user root 222.186.31.83 port 35207 [preauth]
    Oct 11 03:04:39 ns5002486 sshd[32045]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.186.31.83  user=root
    Oct 11 03:04:39 ns5002486 sshd[32134]: Received disconnect from 218.92.0.208 port 42769:11:  [preauth]
    Oct 11 03:04:39 ns5002486 sshd[32134]: Disconnected from authenticating user root 218.92.0.208 port 42769 [preauth]
    Oct 11 03:04:39 ns5002486 sshd[32134]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=218.92.0.208  user=root
    Oct 11 03:04:39 ns5002486 sshd[32191]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=218.92.0.208  user=root
    Oct 11 03:04:40 ns5002486 sshd[32189]: Failed password for root from 218.92.0.208 port 52261 ssh2
    Oct 11 03:04:41 ns5002486 sshd[32193]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.186.31.83  user=root
    lines 1304-1365/1365 (END)
0
задан 11 October 2020 в 06:13

1 ответ

Существует четко сформулированная проблема (я скопировал соответствующие части):

mysqld: Error on realpath() on '/var/lib/mysql-files' (Error 2 - No such file or directory)
[ERROR] Failed to access directory for --secure-file-priv. 
Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /va
Aborting
Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.

У нее есть хорошо известные решения, такие как та, которую я беру из serverfault:

Чтобы решить эту проблему, сначала проверьте пользователя, от имени которого пытается запуститься ваш mysqld; это будет пользователь «mysql» в установке Debian по умолчанию (я предполагаю, что это должно быть то же самое для Ubuntu); чтобы убедиться в этом, проверьте /etc/mysql/my.cnf и найдите строку «user = xxx».

Как только вы узнаете, от имени какого пользователя mysqld пытается работать, проверьте, существует ли каталог /var/lib/mysql-files (sudo mkdir /var/lib/mysql-files если это не так) и принадлежит пользователю mysqld работает как (sudo chown mysql /var/lib/mysql-files, если это не так; замените «mysql» в команде chown с правильным именем пользователя, если вы настроены на запуск от имени другого пользователя).

Затем попробуйте sudo mysqld еще раз, и вы должны либо получить успешный запуск mysqld, либо (если есть другие проблемы с вашей настройкой) новое и другое сообщение об ошибке.

0
ответ дан 11 October 2020 в 13:31

Другие вопросы по тегам:

Похожие вопросы: