Issues with Mysql Server in Ubuntu MATE 16.10

After installing MySQL and importing my data, mysql will not start on the next boot.
This is on a laptop and i have Ubuntu Mate 16.10-64 installed. I think it is a problem with systemd.

If I do a ps on it this is what I see.

root 4657 1 0 21:01 ? 00:00:00 /bin/bash /usr/share/mysql/mysql-systemd-start post

If I try to restart it I get the following:

terry@Mercury:~$ sudo systemctl restart mysql
[sudo] password for terry:
Job for mysql.service failed because the control process exited with error code.
See “systemctl status mysql.service” and “journalctl -xe” for details.
systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
Active: activating (start-post) (Result: exit-code) since Tue 2016-10-25 21:0
Process: 5940 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 5933 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exit
Main PID: 5940 (code=exited, status=1/FAILURE); Control PID: 5941 (mysql-system
Tasks: 2 (limit: 4915)
CGroup: /system.slice/mysql.service
├─5941 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─5988 sleep 1

Oct 25 21:07:39 Mercury systemd[1]: Starting MySQL Community Server…
Oct 25 21:07:42 Mercury systemd[1]: mysql.service: Main process exited, code=exi

If I follow I can reinstall mysql, but once I add data to the server I am right back to the beginning.


These are the steps I took to correct this:

Back up your my.cnf file in /etc/mysql and remove itRemove the folder /etc/mysql/mysql.conf.d/Verify you don’t have a my.cnf file stashed somewhere else (I did in my home dir!) or in /etc/alternatives/my.cnf.Backup and remove /etc/mysql/debian.cnf files (not sure if needed, but just in case)

sudo apt purge mysql-server mysql-server-5.7 mysql-server-core-5.7
sudo apt install mysql-server
In case your syslog shows an error like “mysqld: Can’t read dir of ‘/etc/mysql/conf.d/’” create a symbolic link ln -s /etc/mysql/mysql.conf.d /etc/mysql/conf.d Then the service should be able to start with service mysql start.

I consider mysql or mariadb a requirement for my computing needs. Mariadb will not install.

I can’t reproduce in 16.04, db is working fine and service is autostart on boot.
If someone can reproduce on 16.10 it might be worth putting a bug report up on launchpad.

Kind of a boring answer but:

  1. what does the mysql log outputs? It must be much more verbose than what you’re being shown on screen. Also, what about the results of “systemctl status mysql.service” and “journalctl -xe”?
  2. dmesg (or /var/log/messages) states anything more verbose too?


It wouldn’t let me post my answer here. Did you get my email?