Ubuntu MySQL не работает

0

Ubuntu 16.04. Когда я пытаюсь "sudo service mysql restart", я получил результат:

Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

статус сервиса mysql:

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; disabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Sun 2018-06-10 17:07:52 +05; 29s ago
  Process: 1515 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 1505 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 1515 (code=exited, status=1/FAILURE);         : 1516 (mysql-systemd-s)
   CGroup: /system.slice/mysql.service
           └─control
             ├─1516 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─1698 sleep 1
Jun 10 17:10:24 murabye-extensa systemd[1]: Starting MySQL Community Server...
Jun 10 17:10:26 murabye-extensa systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

journalctl:

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has failed.
-- 
-- The result is failed.
Jun 10 17:11:25 murabye-extensa systemd[1]: mysql.service: Unit entered failed state.
Jun 10 17:11:25 murabye-extensa systemd[1]: mysql.service: Failed with result 'exit-code'.
Jun 10 17:11:25 murabye-extensa systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Jun 10 17:11:25 murabye-extensa systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has finished shutting down.
Jun 10 17:11:25 murabye-extensa systemd[1]: Starting MySQL Community     Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has begun starting up.
Jun 10 17:11:25 murabye-extensa audit[2427]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/2427/status" pid=2427 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=122
Jun 10 17:11:25 murabye-extensa audit[2427]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=2427 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=0
Jun 10 17:11:25 murabye-extensa audit[2427]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/2427/status" pid=2427 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=122
Jun 10 17:11:25 murabye-extensa kernel: audit: type=1400 audit(1528632685.885:6767): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/2427/status" pid=2427 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=122
Jun 10 17:11:25 murabye-extensa kernel: audit: type=1400 audit(1528632685.885:6768): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=2427 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=0
Jun 10 17:11:25 murabye-extensa kernel: audit: type=1400 audit(1528632685.885:6769): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/2427/status" pid=2427 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=122 ouid=122
Jun 10 17:11:27 murabye-extensa systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

Раньше я пытался изменить стандартную текстовую кодировку на utf-8:

sudo nano /etc/mysql/conf.d/utf8_set.cnf

Теперь у меня было это (в файле)

[mysqld]
default-character-set=utf8

[client]
default-character-set=utf8

Я не мог правильно отключить mysql, потому что не мог понять, как выйти. Ввод "\ e" не помогает мне

Теги:
ubuntu-16.04

1 ответ

0
Лучший ответ

Я нахожу ответ: проблема была в файле utf8_set.cnf. Правильно:

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

И я могу закрыть консоль mysql, набрав "exit".

Ещё вопросы

Сообщество Overcoder
Наверх
Меню