Results 1 to 9 of 9

Thread: [SOLVED] mysql fails to start

  1. #1
    Join Date
    May 2008
    Location
    Bellingham, WA
    Beans
    16

    [SOLVED] mysql fails to start

    During boot-up MySQL fails to start. I’ve gone through several different forums, and the two main problems I’ve seen posted were: 1. mysql-server was not installed, and I’ve verified mine is. 2. In the /etc/mysql/my.cnf file the bind-address was incorrect, normally due to the IP address of the server changing. I’ve verified mine is set to the loop-back, 127.0.0.1.

    When I try to start MySQL manually, by using the command “sudo /etc/init.d/mysql start”, it fails. When I try to start MySQL manually, by using the command “sudo mysql start”, it fails giving “ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)”.

    Anybody know what I can do or where I should look?

    I’ve had some permissions problems in the past, this could be related to that, but I’ve not been able to find anything.

  2. #2
    Join Date
    Jan 2008
    Beans
    333

    Question Re: mysql fails to start

    Do /var/log/mysql.err and mysql.log and messages tell us anything useful? It has to be something screwed up in the config or a permission issue like you suggested.

  3. #3
    Join Date
    May 2008
    Location
    Bellingham, WA
    Beans
    16

    Re: mysql fails to start

    I opened both of those files (mysql.err and mysql.log) with the nano command. Both of these files are empty though.

  4. #4
    Join Date
    Jan 2005
    Location
    South Africa
    Beans
    2,098
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: mysql fails to start

    There are two parts to mysql:
    the server (mysqld) and the client (mysql)

    With your second attempt (sudo mysql start), you're trying to start the client, not the server.

    I don't run an Ubuntu server, so I don't know if sudo /etc/init.d/mysql start is the correct command? You say it fails, so what is the error that you get?
    If you don't make backups of your important data, your data is obviously not important to you.

  5. #5
    Join Date
    May 2008
    Location
    Bellingham, WA
    Beans
    16

    Re: mysql fails to start

    When doing the sudo /etc/init.d/mysql start it goes through what looks like the same process as when the system is booting up. It says "* Starting MySQL database server mysqld" and it waits a few seconds, then to the right of that comes up "[fail]".

  6. #6
    Join Date
    May 2008
    Location
    Bellingham, WA
    Beans
    16

    Re: mysql fails to start

    Turns out it was a permissions problem, and one that suprised me at that. The /var/log/mysql folde was owned by root somehow, but was supposed to be owned by mysql. So, I changed it back, and now it works fine.

  7. #7
    Join Date
    Oct 2006
    Beans
    20

    Re: mysql fails to start

    Quote Originally Posted by infosys View Post
    Turns out it was a permissions problem, and one that suprised me at that. The /var/log/mysql folde was owned by root somehow, but was supposed to be owned by mysql. So, I changed it back, and now it works fine.
    Might also want to check /var/run/mysqld and make sure that's owned by the mysql user. That fixed it for me.

  8. #8
    Join Date
    May 2009
    Beans
    1

    Re: [SOLVED] mysql fails to start

    jgeewax, that worked for me as well; I had to create the /var/mysqld directory and make it owned by mysql. and then everything went from near-silently not starting to starting without a problem.

    I'd been running mysql without problems for ages at this point, why on earth would this suddenly become a problem?

  9. #9
    Join Date
    Mar 2012
    Beans
    1

    Re: [SOLVED] mysql fails to start

    Kind of a necrothread, but it appeared as one of the top results on google for "ubuntu mysql suddenly fails".
    I've had the same problem mentioned here, but for my VirtualBox Ubuntu server 11.04 installation, it was simply running out of available disk space. Clearing the cached package files via "apt-get clean", freeing up some additional space, allowed me to start the mysql daemon just fine again. I couldn't find any log messages pointing to that problem, so basically this was a long shot. But it worked.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •