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



Adv Reply

Bookmarks