Results 1 to 10 of 13

Thread: MySQL Startup Failing/Hanging in 10.04

Hybrid View

  1. #1
    Join Date
    May 2010
    Location
    Germany + Sweden
    Beans
    3

    MySQL Start Up Failing/Hanging in 10.04

    Hi,

    After upgrading to Ubuntu 10.04, MySQL wouldn't start up again. Several solutions had been discussed in this forum, but none of them would fit in my situation. I finally found a way which I want to outline here.

    Symptom: "start mysql" or "service mysql start" (as root) hangs.

    Reason: In /etc/init/mysql.conf, there is an infinite loop in the post-start script due to an incomplete migration of MySQL.

    Fix: Create an additional user in the schema "mysql".

    Steps:

    1. Look at /etc/mysql/debian.cnf. Extract the cryptic, bun unencrypted password for user "debian-sys-maint".
    2. Start mysql using "/usr/sbin/mysqld" (as root).
    3. Log in as mysql (or "su - mysql").
    4. Connect to mysql as root: "mysql -u root --password=XXXX".
    5. Create the user "debian-sys-maint", using the password retrieved in step 1: "create user 'debian-sys-maint' identified by 'btIgH81mUXcfZdCQ';".
    6. Get the pid of mysqld: "ps ax | grep -i mysqld". Example: "3024 ? Ssl 0:00 /usr/sbin/mysqld"
    7. Kill this process: "kill -5 3024".
    8. Start mysql (as root): "start mysql". Eventually you see an error message that mysql is already running; this can happen if you tried the command before and cancelled it with control-c. In this case, enter "stop mysql" and "start mysql".
    9. Reboot to see if MySQL starts up automatically.
    10. If the automatic startup still fails, you may follow the advice from a different thread: change the start condition in /etc/init/mysql.conf to "start on (net-device-up IFACE=ethX)", where "X" is the interface you have mysql bound to, e.g. ETH1.
    11. In my case, I had another very specific problem: I'm running Ubuntu in a VM with several virtual disks which were not mounted yet when the network was up. Quite tricky to figure out. So I modified the start condition to "start on (net-device-up IFACE=eth1 and stopped mountall)", and now everything is fine.

    Det var det det!

    Cheers,

    Thomas
    Last edited by Thomas Gutzmann; May 7th, 2010 at 02:33 PM. Reason: Added hint 11.

  2. #2
    Join Date
    Nov 2008
    Beans
    1

    Re: MySQL Startup Failing/Hanging in 10.04

    Good work / godt arbejde

  3. #3
    Join Date
    May 2010
    Beans
    1

    Re: MySQL Startup Failing/Hanging in 10.04

    Hello,
    I have the same problem in 10.04. I try to follow this steps, but when I start /usr/sbin/mysqld as root, it failed with messages:

    100509 14:36:53 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

    100509 14:36:53 [ERROR] Aborting

    100509 14:36:53 [Note] /usr/sbin/mysqld: Shutdown complete

    and it's impossible to finish your instructions and start MySQL.

  4. #4
    Join Date
    May 2010
    Location
    Germany + Sweden
    Beans
    3

    Re: MySQL Startup Failing/Hanging in 10.04

    Hi Jordan,

    Please have a look at http://dev.mysql.com/doc/mysql-secur...st-attack.html.

    My guess is that in your /etc/mysql/my.cnf in section [mysqld] you have

    user = root

    Change this to

    user = mysql

    If you have still problems, give me your my.cnf. You should also capture the messages in /var/log/messages while you run "start mysql" or "/usr/sbin/mysql" and include it, too.

    Cheers,

    Thomas

  5. #5
    Join Date
    Dec 2006
    Location
    The Milkyway
    Beans
    9
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: MySQL Startup Failing/Hanging in 10.04

    That's some great detective work there.

    That fixed the hangs when trying to start/stop the service. And it fixed the "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)" message whenever I tried running mysql.

    And Webmin is able to administer the database. Thanks!

  6. #6
    Join Date
    Jun 2010
    Beans
    1

    Re: MySQL Startup Failing/Hanging in 10.04

    Hello,

    I had the same problem: infinite loop in "post-start script" in /etc/init/mysql.conf
    Reason was a incorrect path to the socket in /etc/mysql/debian.cnf (there are two lines "socket = ..."!)
    After correctiing the pathes everything worked fine.

  7. #7
    Join Date
    Aug 2012
    Beans
    8

    Re: MySQL Start Up Failing/Hanging in 10.04

    Quote Originally Posted by Thomas Gutzmann View Post
    Hi,

    After upgrading to Ubuntu 10.04, MySQL wouldn't start up again. Several solutions had been discussed in this forum, but none of them would fit in my situation. I finally found a way which I want to outline here.

    Symptom: "start mysql" or "service mysql start" (as root) hangs.

    Reason: In /etc/init/mysql.conf, there is an infinite loop in the post-start script due to an incomplete migration of MySQL.

    Fix: Create an additional user in the schema "mysql".

    Steps:

    1. Look at /etc/mysql/debian.cnf. Extract the cryptic, bun unencrypted password for user "debian-sys-maint".
    2. Start mysql using "/usr/sbin/mysqld" (as root).
    3. Log in as mysql (or "su - mysql").
    4. Connect to mysql as root: "mysql -u root --password=XXXX".
    5. Create the user "debian-sys-maint", using the password retrieved in step 1: "create user 'debian-sys-maint' identified by 'btIgH81mUXcfZdCQ';".
    6. Get the pid of mysqld: "ps ax | grep -i mysqld". Example: "3024 ? Ssl 0:00 /usr/sbin/mysqld"
    7. Kill this process: "kill -5 3024".
    8. Start mysql (as root): "start mysql". Eventually you see an error message that mysql is already running; this can happen if you tried the command before and cancelled it with control-c. In this case, enter "stop mysql" and "start mysql".
    9. Reboot to see if MySQL starts up automatically.
    10. If the automatic startup still fails, you may follow the advice from a different thread: change the start condition in /etc/init/mysql.conf to "start on (net-device-up IFACE=ethX)", where "X" is the interface you have mysql bound to, e.g. ETH1.
    11. In my case, I had another very specific problem: I'm running Ubuntu in a VM with several virtual disks which were not mounted yet when the network was up. Quite tricky to figure out. So I modified the start condition to "start on (net-device-up IFACE=eth1 and stopped mountall)", and now everything is fine.

    Det var det det!

    Cheers,

    Thomas
    This could very well be a fix, however, I am not allowed to edit debian.cnf as it is owned by root. Any ideas on how to get around that?

    EDIT: nevermind - figured it out via
    sudo gedit debian.cnf
    Last edited by arizonanoob; August 13th, 2012 at 08:55 PM.

Tags for this Thread

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
  •