0

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.

6
  • What custom command did you try?
    – edwinksl
    Jun 30, 2016 at 4:56
  • 'Sudo service mysql start' - the same command
    – Diksha
    Jun 30, 2016 at 4:57
  • Try 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.
    – eyoung100
    Jun 30, 2016 at 5:00
  • Its giving this result - Usage: /etc/init.d/mysql start|stop|restart|reload|force-reload|status
    – Diksha
    Jun 30, 2016 at 5:04
  • 2
    @eyoung100 Real systemd syntax would have been systemctl enable mysql && systemctl start mysql.
    – Jos
    Jun 30, 2016 at 8:01

1 Answer 1

2

Use this:

sudo update-rc.d mysql defaults
3
  • do i need to use this as boot command?
    – Diksha
    Jun 30, 2016 at 5:18
  • Really thanks a lot , its working like a charm.... although it takes some time in phpmyadmin . I just prepared myself to reinstall ubuntu 14.04.
    – Diksha
    Jun 30, 2016 at 5:26
  • Good to know it helped you. Jun 30, 2016 at 5:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .