I have recently bought a new laptop running Ubuntu 16.04.1 LTS (64 bit). I have installed dozens of applications, but one is giving me a major headache and any help would be gratefully received.
I start from a clean slate with regard to mysql:
sudo apt remove --purge mysql-server mysql-client mysql-common
sudo apt autoremove
sudo rm -rf /var/lib/mysql*
sudo apt install mysql-server
I install my database from backup and everything works fine.
I power-off/power-on the laptop and mysql isn't working. Firstly the daemon is not running:
ps -A | grep sql
2056 ? 00:00:00 mysql-systemd-s
but something I don't recognise called mysql-systemd-s is running.
It is now impossible to use mysql:
mysql -u root -p
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial
communication packet', system error: 104
The service seems to be unstartable:
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.
but neither of these is useful. The /var/log/mysql/error.log has a little more information:
......
2017-01-13T21:01:04.926244Z 0 [Warning] Failed to set up SSL because
of the following SSL library error: SSL context is not usable without
certificate and private key
2017-01-13T21:01:04.926272Z 0 [Note] Server hostname (bind-address):
'127.0.0.1'; port: 3306
2017-01-13T21:01:04.926288Z 0 [Note] - '127.0.0.1' resolves to
'127.0.0.1';
2017-01-13T21:01:04.926327Z 0 [Note] Server socket created on IP:
'127.0.0.1'.
2017-01-13T21:01:04.927774Z 0 [ERROR] Fatal error: mysql.user table is damaged. Please run mysql_upgrade.
2017-01-13T21:01:04.927897Z 0 [ERROR] Aborting
However, the recommendation to run mysql_upgrade is useless because one can't run mysql_upgrade unless the mysql server is running! And the mysql server isn't running because of this error.
So, I remove and re-install everything and run mysql_upgrade. This seems to complete without error. But, again when I power cycle the machine, I'm back without mysql working.
I have also tried starting the mysqld with the --skip-grant-tables options, but this still does not allow connexion.
At the moment, every time I reboot my computer I have to remove all traces of mysql, re-install mysql and then reload my database from a backup. This is a real pain.
Does anyone have any ideas about what's happening?