Why does MySQL not start on boot of Ubuntu?

cpopin March 14, 2010
Whatsapp Pinterest
Ads by Google

I’m getting this annoying error when I start MySQL server:

root@blix:~# /etc/init.d/mysql start
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
root@blix:~# ERROR 1045 (28000): Access denied for user ‘debian-sys-maint’@’localhost’ (using password: YES)

It’s annoying for several reasons:
1. I believe this error is the reason MySQL is not starting on boot.
2. I have to manually start it myself.
3. This is a design flaw. When I do start it manually, it shows no indication that it has started.

The above command actually starts MySQL, but returns an error code of 3, indicating that it failed. The only way to know for if it started successfully is to do a status and examine the return error value to see if it’s 0. Even that is misleading.
root@blix:~# /etc/init.d/mysql status; echo $?
/usr/bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘debian-sys-maint’@’localhost’ (using password: YES)’

I applied the following answer I found in the Internet to no avail:

GRANT ALL PRIVILEGES ON *.* TO ‘debian-sys-maint’@’localhost’ IDENTIFIED BY ‘cvy9VhFwfvw3ghKM’;

This command added the debian-sys-maint user, but didn’t fix the problem.

Any ideas would be appreciated.

-=- cpopin

P.S. I’m an old Experts Exchange expert who’s dissatisfied with their business model and thought I’d give makeusof.com a chance.

  1. Wcdrotar
    January 2, 2011 at 2:51 pm

    Try logging as root instead of sysmaint

  2. ipod to mac
    April 5, 2010 at 2:22 pm

    I've encountered this problem while transferring files from my ipod to mac. I don't know why does MySQL not start on boot of Ubuntu.. Any ideas? Thanks for this post..

  3. Anonymous
    March 15, 2010 at 1:27 pm

    That error is when you start it manually or via your startup script? Have you checked out this thread here http://ubuntuforums.org/showthread.php?t=991026 ?

    Can you post your startup script?