I am using Ubuntu 16.04 LTS and mysql 5.6
Each time after the server reboots, MySQL service fails to start automatically. I've determine this by checking the directory: /var/run/mysqld/
and there is no mysqld.sock
, however when I run the command sudo service mysql status
, it shows that MySQL is running!!!
I have to restart MySQL with sudo service mysql restart
, and then suddenly mysqld.sock
and the .pid
file will be generated, and mysql
starts working.
Every time after boot I have to run this command manually. I have created custom command in startup applications but it's not working.
sudo service mysql enable && sudo service mysql start
Enable adds it to the init service runlevel, a.k.a. systemd, and the start starts it for the current session. If the command returns that the service is already enabled the status is correct.Usage: /etc/init.d/mysql start|stop|restart|reload|force-reload|status
systemctl enable mysql && systemctl start mysql
.