3

The MySQL server quit working when I was installing Drupal, the last version. Then I reinstalled the MySQL server, but without success. It fails to start.

Output of sudo service mysql start

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

Output of systemctl status mysql.service

? mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Sat 2017-05-13 23:40:38 UTC; 5s ago
  Process: 32760 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 32744 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 32760 (code=exited, status=1/FAILURE); Control PID: 32763 (mysql-systemd-s)
Tasks: 2 (limit: 4915)
   Memory: 736.0K
   CPU: 58ms
   CGroup: /system.slice/mysql.service
       +-control
         +-  308 sleep 1
         +-32763 /bin/bash /usr/share/mysql/mysql-systemd-start post
May 13 23:40:38 ubuntu-512mb-tor1-01 systemd[1]: Starting MySQL Community Server...
May 13 23:40:38 ubuntu-512mb-tor1-01 mysql-systemd-start[32744]: my_print_defaults: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:40:38 ubuntu-512mb-tor1-01 mysql-systemd-start[32744]: my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:40:38 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

Output of journalctl -xe

May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=32760 comm="mysqld" requested_mask="
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.737:7854): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=3
May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=32760 comm="mysqld" requested
May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=32760 comm="mysqld" requested_mask="
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.741:7855): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.741:7856): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=3
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:40:38 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
May 13 23:41:08 ubuntu-512mb-tor1-01 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 failed.
May 13 23:41:08 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Unit entered failed state.
May 13 23:41:08 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Failed with result 'exit-code'.
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
May 13 23:41:09 ubuntu-512mb-tor1-01 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.
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has begun starting up.
May 13 23:41:09 ubuntu-512mb-tor1-01 mysql-systemd-start[362]: my_print_defaults: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:41:09 ubuntu-512mb-tor1-01 mysql-systemd-start[362]: my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.245:7857): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378 comm="mysqld" requested_mask="r" den
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=378 comm="mysqld" requested_mas
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378 comm="mysqld" requested_mask="r" den
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.249:7858): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.249:7859): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378
May 13 23:41:09 ubuntu-512mb-tor1-01 mysqld[378]: mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:41:09 ubuntu-512mb-tor1-01 mysqld[378]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
lines 2142-2184/2184 (END)
May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=32760 comm="mysqld" requested_mask="
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.737:7854): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=3
May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=32760 comm="mysqld" requested
May 13 23:40:38 ubuntu-512mb-tor1-01 audit[32760]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=32760 comm="mysqld" requested_mask="
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.741:7855): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/
May 13 23:40:38 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718838.741:7856): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/32760/status" pid=3
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:40:38 ubuntu-512mb-tor1-01 mysqld[32760]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:40:38 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
May 13 23:41:08 ubuntu-512mb-tor1-01 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 failed.
May 13 23:41:08 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Unit entered failed state.
May 13 23:41:08 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Failed with result 'exit-code'.
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
May 13 23:41:09 ubuntu-512mb-tor1-01 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.
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has begun starting up.
May 13 23:41:09 ubuntu-512mb-tor1-01 mysql-systemd-start[362]: my_print_defaults: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:41:09 ubuntu-512mb-tor1-01 mysql-systemd-start[362]: my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.245:7857): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378 comm="mysqld" requested_mask="r" den
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=378 comm="mysqld" requested_mas
May 13 23:41:09 ubuntu-512mb-tor1-01 audit[378]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378 comm="mysqld" requested_mask="r" den
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.249:7858): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/
May 13 23:41:09 ubuntu-512mb-tor1-01 kernel: audit: type=1400 audit(1494718869.249:7859): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/378/status" pid=378
May 13 23:41:09 ubuntu-512mb-tor1-01 mysqld[378]: mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 24!
May 13 23:41:09 ubuntu-512mb-tor1-01 mysqld[378]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
May 13 23:41:09 ubuntu-512mb-tor1-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
  • The error that i see is Found option without preceding group in config file /etc/mysql/my.cnf at line 24!, can you post the content of your /etc/mysql/my.cnf – bistoco May 14 '17 at 0:47
  • I uninstalled the mysql server and now I'm following again the steps from here digitalocean.com/community/tutorials/… and I got some errors when I run the command: # sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql – Andreiasi May 14 '17 at 1:15
  • Reading package lists... Done Building dependency tree Reading state information... Done Package php5-mysql is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Unable to locate package libapache2-mod-auth-mysql E: Package 'php5-mysql' has no installation candidate – Andreiasi May 14 '17 at 1:17
  • that doesn't look like the basic sudo apt-get install mysql-server install – bistoco May 14 '17 at 1:19
  • 1
    @bistoco Even though your comments are from some weeks ago, I suggest posting an answer. Then it will be clear to others, who find this page by searching, what worked for the OP. (I think the OP's comments express that just installing the mysql-server package was sufficient to fix the problem, which I believe is what you were suggesting.) – Eliah Kagan Jul 11 at 16:49
-1

I solved this problem just by removing the mysql-server package.

sudo apt remove mysql-server

I had Ubuntu and LAMP, and when I started LAMP, mysqld (mysql-server) couldn't run. The error that it raised was exactly yours. I hope this solution of uninstalling the mysql-server package works for you.

  • 2
    I think this may be valuable, though I suspect it wouldn't have worked for the OP, who was relying on that package to provide the MySQL part of their LAMP stack. My guess is that you installed LAMP in some way that did not involve using Ubuntu's packages (or that used snap packages instead of deb packages), and that removing the mysql-server package fixed a conflict between the software you had manually installed (or installed through another package manager). – Eliah Kagan Jul 11 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.