web-dev-qa-db-fra.com

MySQL ne démarre pas à cause d'erreurs

J'essaie de faire fonctionner MySQL sur mon serveur Ubuntu. Il semble que j'ai eu des erreurs et que j'essaye de les résoudre moi-même mais je n'ai pas eu de succès. Iran:

Sudo apt-get update
Sudo apt-get upgrade
Sudo apt-get install mysql-server

Après l'installation, j'ai essayé de m'assurer qu'il était allumé en faisant Sudo service mysql start qui finissait par le dire

Le travail pour mysql.service a échoué car le processus de contrôle s'est terminé avec un code d'erreur. Voir "systemctl status mysql.service" et "journalctl -xe" pour plus de détails.

J'ai couru Sudo service mysql status qui a renvoyé ceci:

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Tue 2017-04-04 14:15:55 EEST; 12s ago
  Process: 7451 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 7448 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 7451 (code=exited, status=1/FAILURE);         : 7452 (mysql-systemd-s)
    Tasks: 2
   Memory: 1.0M
      CPU: 245ms
   CGroup: /system.slice/mysql.service
           └─control
             ├─7452 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─7483 sleep 1

Si quelqu'un pouvait m'aider, je l'apprécierais.

EDIT1:

Voici le résultat de journalctl -xe après avoir essayé de démarrer MySql:

-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has failed.
--
-- The result is failed.
Apr 04 15:34:21 ramireini systemd[1]: mysql.service: Unit entered failed state.
Apr 04 15:34:21 ramireini systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 04 15:34:22 ramireini systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Apr 04 15:34:22 ramireini 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.
Apr 04 15:34:22 ramireini 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.
Apr 04 15:34:22 ramireini audit[21899]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/21899/status" pid=21899 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=115 ouid=115
Apr 04 15:34:22 ramireini kernel: audit: type=1400 audit(1491309262.116:1342): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/21899/status" pid=21899 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=115 o
Apr 04 15:34:22 ramireini kernel: audit: type=1400 audit(1491309262.116:1343): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=21899 comm="mysqld" requested_mask="r" denied_mask="r" fsui
Apr 04 15:34:22 ramireini kernel: audit: type=1400 audit(1491309262.116:1344): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/21899/status" pid=21899 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=115 o
Apr 04 15:34:22 ramireini audit[21899]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=21899 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=115 ouid=0
Apr 04 15:34:22 ramireini audit[21899]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/21899/status" pid=21899 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=115 ouid=115
Apr 04 15:34:22 ramireini systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Apr 04 15:34:23 ramireini Sudo[21909]:     root : TTY=pts/6 ; PWD=/ ; USER=root ; COMMAND=/usr/sbin/service mysql start
Apr 04 15:34:23 ramireini Sudo[21909]: pam_unix(Sudo:session): session opened for user root by root(uid=0)
Apr 04 15:34:52 ramireini systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has failed.
--
-- The result is failed.
Apr 04 15:34:52 ramireini systemd[1]: mysql.service: Unit entered failed state.
Apr 04 15:34:52 ramireini Sudo[21909]: pam_unix(Sudo:session): session closed for user root
Apr 04 15:34:52 ramireini systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 04 15:34:52 ramireini systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Apr 04 15:34:52 ramireini 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.
Apr 04 15:34:52 ramireini 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.
Apr 04 15:34:52 ramireini audit[22008]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/22008/status" pid=22008 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=115 ouid=115
Apr 04 15:34:52 ramireini audit[22008]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=22008 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=115 ouid=0
Apr 04 15:34:52 ramireini audit[22008]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/22008/status" pid=22008 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=115 ouid=115
Apr 04 15:34:52 ramireini kernel: audit: type=1400 audit(1491309292.625:1345): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/22008/status" pid=22008 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=115 o
Apr 04 15:34:52 ramireini kernel: audit: type=1400 audit(1491309292.625:1346): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=22008 comm="mysqld" requested_mask="r" denied_mask="r" fsui
Apr 04 15:34:52 ramireini kernel: audit: type=1400 audit(1491309292.625:1347): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/22008/status" pid=22008 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=115 o
Apr 04 15:34:52 ramireini systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
lines 2046-2106/2106 (END)
[weechat] 0:WeeChat 1.4- 1:HTML  2:CSS  3:PHP  4:SQL*                      

https://hastebin.com/kayazumili.txt

Je mets tout dans hastebin pour que les lignes de gazon puissent s’intégrer à cet endroit: p

EDIT2:

Je suis passé par les marches et lors de la réinstallation, j’ai noté ceci:

AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'.

E: Sub-process /usr/bin/dpkg returned an error code (1)

W: Operation was interrupted before it could finish.

Sortie de la commande d’installation de MySQL:

root@ramireini:~# Sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libaio1 libcgi-fast-Perl libcgi-pm-Perl libencode-locale-Perl libevent-core-2.0-5 libfcgi-Perl libhtml-parser-Perl libhtml-tagset-Perl libhtml-template-Perl libhttp-date-Perl libhttp-message-Perl
  libio-html-Perl liblwp-mediatypes-Perl libtimedate-Perl liburi-Perl mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
  libdata-dump-Perl libipc-sharedcache-Perl libwww-Perl mailx tinyca
The following NEW packages will be installed:
  libaio1 libcgi-fast-Perl libcgi-pm-Perl libencode-locale-Perl libevent-core-2.0-5 libfcgi-Perl libhtml-parser-Perl libhtml-tagset-Perl libhtml-template-Perl libhttp-date-Perl libhttp-message-Perl
  libio-html-Perl liblwp-mediatypes-Perl libtimedate-Perl liburi-Perl mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 21 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/19.4 MB of archives.
After this operation, 163 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Perl: warning: Setting locale failed.
Perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_TIME = "fi_FI.UTF-8",
    LC_MONETARY = "fi_FI.UTF-8",
    LC_ADDRESS = "fi_FI.UTF-8",
    LC_TELEPHONE = "fi_FI.UTF-8",
    LC_NAME = "fi_FI.UTF-8",
    LC_MEASUREMENT = "fi_FI.UTF-8",
    LC_IDENTIFICATION = "fi_FI.UTF-8",
    LC_NUMERIC = "fi_FI.UTF-8",
    LC_PAPER = "fi_FI.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
Perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_ALL to default locale: No such file or directory
Preconfiguring packages ...
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package mysql-common.
(Reading database ... 119915 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.7.17-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-common (5.7.17-0ubuntu0.16.04.1) ...
Selecting previously unselected package libaio1:AMD64.
Preparing to unpack .../libaio1_0.3.110-2_AMD64.deb ...
Unpacking libaio1:AMD64 (0.3.110-2) ...
Selecting previously unselected package mysql-client-core-5.7.
Preparing to unpack .../mysql-client-core-5.7_5.7.17-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking mysql-client-core-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-client-5.7.
Preparing to unpack .../mysql-client-5.7_5.7.17-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking mysql-client-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-server-core-5.7.
Preparing to unpack .../mysql-server-core-5.7_5.7.17-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking mysql-server-core-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Selecting previously unselected package libevent-core-2.0-5:AMD64.
Preparing to unpack .../libevent-core-2.0-5_2.0.21-stable-2ubuntu0.16.04.1_AMD64.deb ...
Unpacking libevent-core-2.0-5:AMD64 (2.0.21-stable-2ubuntu0.16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu7) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up mysql-common (5.7.17-0ubuntu0.16.04.1) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-5.7.
(Reading database ... 120084 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.17-0ubuntu0.16.04.1_AMD64.deb ...
locale: Cannot set LC_ALL to default locale: No such file or directory
Unpacking mysql-server-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Selecting previously unselected package libhtml-tagset-Perl.
Preparing to unpack .../libhtml-tagset-Perl_3.20-2_all.deb ...
Unpacking libhtml-tagset-Perl (3.20-2) ...
Selecting previously unselected package liburi-Perl.
Preparing to unpack .../liburi-Perl_1.71-1_all.deb ...
Unpacking liburi-Perl (1.71-1) ...
Selecting previously unselected package libhtml-parser-Perl.
Preparing to unpack .../libhtml-parser-Perl_3.72-1_AMD64.deb ...
Unpacking libhtml-parser-Perl (3.72-1) ...
Selecting previously unselected package libcgi-pm-Perl.
Preparing to unpack .../libcgi-pm-Perl_4.26-1_all.deb ...
Unpacking libcgi-pm-Perl (4.26-1) ...
Selecting previously unselected package libfcgi-Perl.
Preparing to unpack .../libfcgi-Perl_0.77-1build1_AMD64.deb ...
Unpacking libfcgi-Perl (0.77-1build1) ...
Selecting previously unselected package libcgi-fast-Perl.
Preparing to unpack .../libcgi-fast-Perl_1%3a2.10-1_all.deb ...
Unpacking libcgi-fast-Perl (1:2.10-1) ...
Selecting previously unselected package libencode-locale-Perl.
Preparing to unpack .../libencode-locale-Perl_1.05-1_all.deb ...
Unpacking libencode-locale-Perl (1.05-1) ...
Selecting previously unselected package libhtml-template-Perl.
Preparing to unpack .../libhtml-template-Perl_2.95-2_all.deb ...
Unpacking libhtml-template-Perl (2.95-2) ...
Selecting previously unselected package libtimedate-Perl.
Preparing to unpack .../libtimedate-Perl_2.3000-2_all.deb ...
Unpacking libtimedate-Perl (2.3000-2) ...
Selecting previously unselected package libhttp-date-Perl.
Preparing to unpack .../libhttp-date-Perl_6.02-1_all.deb ...
Unpacking libhttp-date-Perl (6.02-1) ...
Selecting previously unselected package libio-html-Perl.
Preparing to unpack .../libio-html-Perl_1.001-1_all.deb ...
Unpacking libio-html-Perl (1.001-1) ...
Selecting previously unselected package liblwp-mediatypes-Perl.
Preparing to unpack .../liblwp-mediatypes-Perl_6.02-1_all.deb ...
Unpacking liblwp-mediatypes-Perl (6.02-1) ...
Selecting previously unselected package libhttp-message-Perl.
Preparing to unpack .../libhttp-message-Perl_6.11-1_all.deb ...
Unpacking libhttp-message-Perl (6.11-1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.17-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-server (5.7.17-0ubuntu0.16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu16) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up libaio1:AMD64 (0.3.110-2) ...
Setting up mysql-client-core-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Setting up mysql-client-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Setting up mysql-server-core-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Setting up libevent-core-2.0-5:AMD64 (2.0.21-stable-2ubuntu0.16.04.1) ...
Setting up mysql-server-5.7 (5.7.17-0ubuntu0.16.04.1) ...
locale: Cannot set LC_ALL to default locale: No such file or directory
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
â— mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Tue 2017-04-04 19:01:59 EEST; 21ms ago
  Process: 25878 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
  Process: 25877 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 25872 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 25877 (code=exited, status=1/FAILURE)

Apr 04 19:01:59 ramireini systemd[1]: Failed to start MySQL Community Server.
Apr 04 19:01:59 ramireini systemd[1]: mysql.service: Unit entered failed state.
Apr 04 19:01:59 ramireini systemd[1]: mysql.service: Failed with result 'exit-code'.
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up libhtml-tagset-Perl (3.20-2) ...
Setting up liburi-Perl (1.71-1) ...
Setting up libhtml-parser-Perl (3.72-1) ...
Setting up libcgi-pm-Perl (4.26-1) ...
Setting up libfcgi-Perl (0.77-1build1) ...
Setting up libcgi-fast-Perl (1:2.10-1) ...
Setting up libencode-locale-Perl (1.05-1) ...
Setting up libhtml-template-Perl (2.95-2) ...
Setting up libtimedate-Perl (2.3000-2) ...
Setting up libhttp-date-Perl (6.02-1) ...
Setting up libio-html-Perl (1.001-1) ...
Setting up liblwp-mediatypes-Perl (6.02-1) ...
Setting up libhttp-message-Perl (6.11-1) ...
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for libc-bin (2.23-0ubuntu7) ...
Processing triggers for systemd (229-4ubuntu16) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@ramireini:~#

Sortie de Sudo apt -o Dpkg::Options::="--force-confmiss" install --reinstall mysql-server:

root@ramireini:/# Sudo apt -o Dpkg::Options::="--force-confmiss" install --reinstall mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
  mailx tinyca
The following NEW packages will be installed:
  mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 6 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/18,7 MB of archives.
After this operation, 160 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 89934 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.7.17-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-common (5.7.17-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-client-core-5.7.
Preparing to unpack .../mysql-client-core-5.7_5.7.17-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking mysql-client-core-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-client-5.7.
Preparing to unpack .../mysql-client-5.7_5.7.17-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking mysql-client-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-server-core-5.7.
Preparing to unpack .../mysql-server-core-5.7_5.7.17-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking mysql-server-core-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up mysql-common (5.7.17-0ubuntu0.16.04.1) ...

Configuration file '/etc/mysql/conf.d/mysql.cnf', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/mysql/conf.d/mysqldump.cnf', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/mysql/my.cnf.fallback', does not exist on system.
Installing new config file as you requested.
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-5.7.
(Reading database ... 90091 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.17-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking mysql-server-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.17-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-server (5.7.17-0ubuntu0.16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu16) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up mysql-client-core-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Setting up mysql-client-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Setting up mysql-server-core-5.7 (5.7.17-0ubuntu0.16.04.1) ...
Setting up mysql-server-5.7 (5.7.17-0ubuntu0.16.04.1) ...

Configuration file '/etc/apparmor.d/usr.sbin.mysqld', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/init.d/mysql', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/init/mysql.conf', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/logcheck/ignore.d.paranoid/mysql-server-5_7', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/logcheck/ignore.d.server/mysql-server-5_7', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/logcheck/ignore.d.workstation/mysql-server-5_7', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/logrotate.d/mysql-server', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/mysql/debian-start', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/mysql/mysql.cnf', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/mysql/mysql.conf.d/mysqld.cnf', does not exist on system.
Installing new config file as you requested.

Configuration file '/etc/mysql/mysql.conf.d/mysqld_safe_syslog.cnf', does not exist on system.
Installing new config file as you requested.
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since ti 2017-04-04 21:40:43 EEST; 16ms ago
  Process: 3090 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
  Process: 3089 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 3085 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 3089 (code=exited, status=1/FAILURE)

huhti 04 21:40:43 ramireini systemd[1]: Failed to start MySQL Community Server.
huhti 04 21:40:43 ramireini systemd[1]: mysql.service: Unit entered failed state.
huhti 04 21:40:43 ramireini systemd[1]: mysql.service: Failed with result 'exit-code'.
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for systemd (229-4ubuntu16) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@ramireini:/# 
4
Frozen

Le problème avec le démarrage du serveur était une protection par Apparmor pour se protéger contre les applications non autorisées en cours d'exécution.

Ceci a été corrigé en ajoutant la ligne de commande:

$ Sudo ln -s /etc/apparmor.d/usr.sbin.mysqld

D'autres composants importants protégeaient le serveur mysql installé contre les conflits, mais le purgeaient puis le réinstallaient. Assurez-vous que les valeurs par défaut sont définies en supprimant les défaillances et en réinstallant ce qui est testé à partir du référentiel, ce qui fonctionne.

Au cours du processus de réinstallation (dans ce cas), un problème est survenu avec le script Perl, qui fait partie de la routine d'installation. La résolution de ces problèmes et erreurs a facilité la réinstallation.

Les détails des problèmes qui étaient à l’origine des problèmes ont été présentés, l’élimination de chacun des problèmes constituant une récupération étape par étape.

1
L. D. James

Comme décrit ici après avoir installé mysql-server en utilisant:

Sudo apt-get update
Sudo apt-get install mysql-server

Vous devriez configurer mysql:

Sudo mysql_secure_installation

Ensuite, testez votre configuration en utilisant:

systemctl status mysql.service

Si MySQL n'est pas en cours d'exécution, vous pouvez le démarrer avec Sudo systemctl mysql start.

Pour une vérification supplémentaire, vous pouvez essayer de vous connecter à la base de données à l'aide de l'outil mysqladmin, un client qui vous permet d'exécuter des commandes administratives. Par exemple, cette commande indique de se connecter à MySQL en tant que root (-u root), demander un mot de passe (-p) et renvoyer la version.

mysqladmin -p -u root version
3
Yaron

Tout d'abord, vous voulez arrêter d'utiliser la structure service <ITEM> <COMMAND> et commencer à vous habituer à la structure systemctl <COMMAND> <ITEM>

Deuxièmement, systemd peut vous donner de meilleures informations si vous vérifiez la journalisation via son outil journalctlname__:

Sudo journalctl -xe -u mysql

Cela devrait vous donner plus d'informations sur ce qui s'est passé. Le "statut" ne vous dira pas nécessairement les événements à l'origine de l'erreur.

2
taifwa