7

After a good deal of troubleshooting I have managed to get Plasma running however MySQL will still not start

systemctl status mysql.service
â mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Thu 2016-05-26 15:43:35 CDT; 36s ago
  Process: 18735 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
  Process: 18734 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 18946 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
 Main PID: 18734 (code=exited, status=1/FAILURE)

May 26 15:43:34 Stark.newbierpg.com systemd[1]: Failed to start MySQL Community Server.
May 26 15:43:34 Stark.newbierpg.com systemd[1]: mysql.service: Unit entered failed state.
May 26 15:43:34 Stark.newbierpg.com systemd[1]: mysql.service: Failed with result 'exit-code'.
May 26 15:43:35 Stark.newbierpg.com systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
May 26 15:43:35 Stark.newbierpg.com systemd[1]: Stopped MySQL Community Server.
May 26 15:43:35 Stark.newbierpg.com systemd[1]: mysql.service: Start request repeated too quickly.
May 26 15:43:35 Stark.newbierpg.com systemd[1]: Failed to start MySQL Community Server.
root@Stark:/etc# 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.
root@Stark:/etc# 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 Thu 2016-05-26 15:47:30 CDT; 3s ago
  Process: 20207 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 20205 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 20207 (code=exited, status=1/FAILURE);         : 20208 (mysql-systemd-s)
   CGroup: /system.slice/mysql.service
           ââcontrol
             ââ20208 /bin/bash /usr/share/mysql/mysql-systemd-start post
             ââ20245 sleep 1

May 26 15:47:30 Stark.newbierpg.com systemd[1]: Starting MySQL Community Server...
May 26 15:47:33 Stark.newbierpg.com systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
7

we were also facing same issue after Upgarde from 14.04 to 16.04 Solved the problem by removing

myisam-recover = BACKUP

and

key_buffer = 16M

from my.cnf.

Then use

sudo service mysql start

to start the MySQL daemon again and

sudo apt-get -f install 

to recover your system packaging state.

I found this advicehere: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1570673, you can check also

| improve this answer | |
  • My my.cnf had to copies of the key_buffer = 16M line. I had to kill both of them. – Daniel Bidwell Jun 30 '16 at 1:40
  • Sidenote: You don't need to kill your key_buffer entries, just rename them to key_buffer_size as the former is now deprecated in newer MySQL versions. – fevangelou Jul 20 '16 at 13:38
  • i dont have multiple my.cnf files with different sizes but when i open them they are all empty. if i try to re-install mysql i get E: mysql-server-5.7: subprocess installed post-installation script returned error exit status 1 E: mysql-server: dependency problems - leaving unconfigured – Bizmate Aug 8 '16 at 6:57
  • I had this as well on a fresh 16.04! On MariaDB 10.0 this. – Recct Sep 1 '16 at 19:47
4

I can't rate or comment, but in a fresh install of Ubuntu I used below then reinstalled and worked fine!

apt-get purge mysql-*
rm -fr /var/lib/mysql*
| improve this answer | |
  • Thank you for your contribution. However, I doubt the OP did not think about it, neither what your answer adds to existing ones (of which one is accepted). – Marc Vanhoomissen Jun 26 '17 at 11:10
2

I was getting this message when trying to start or restart mysql

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

and when using

systemctl status mysql.service

I get this message

mysql.service - MySQL Community Server <br>
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)<br>
   Active: activating (start-post) (Result: exit-code) since Thu 2016-11-10 17:09:58 AST; 24s ago<br>
Process: 31363 ExecStart=/usr/sbin/mysqld **(code=exited, status=1/FAILURE)**
Process: 31360 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre **(code=exited, status=0/SUCCESS)**<br>
Main PID: 31363 **(code=exited, status=1/FAILURE)**;         : 31364 (mysql-systemd-s)<br>
CGroup: /system.slice/mysql.service<br>
       └─control<br>
         ├─31364 /bin/bash /usr/share/mysql/mysql-systemd-start post
         └─31441 sleep 1<br>

The problem was because of issues in the file /etc/mysql/my.cnf. You can troubleshoot using mysql - it will show you where the error is like this :

mysql: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at **line 20**!
mysql: [ERROR] Fatal error in defaults handling. Program aborted!

The you can try to solve it by commenting out (be inserting # at the start of the line) the offending settings and so on.

| improve this answer | |
  • 5
    Just running mysql would troubleshoot it? in my computer it just says that can't connect to mysql through socket. – neves Mar 3 '17 at 3:26
0

I googled a lot, but none of the answers worked for me. I ended up with installing MySQL 5.6 ;(. Ubuntu 16.04 comes with MySQL 5.7 by default. If you don't have a specific reason to use 5.7, staying with 5.6 might be a time saving option.

apt-get purge mysql-*
rm -fr /var/lib/mysql*
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
apt-get update
apt install mysql-server-5.6
| improve this answer | |
  • 3
    Adding repositories of other Ubuntu releases (without proper Apt rules in place) is begging for trouble. -1 – David Foerster Jun 23 '17 at 9:20

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