MySQL won't restart...and how easy it is to reset MySQL passwords
mysqld is dead
I just found out that the MySQL server on one of my servers hasn't been running for a month. That is kind of embarrassing. But I thought I would just start it back up and life would be good again.
Except it didn't want to start. Strange!
This is what the log looked like when I tried to start MySQL:
Jul 13 05:45:41 li91-222 mysqld[17063]: 100713 5:45:41 [Warning] option 'thread_stack': unsigned value 65536 adjusted to 131072
Jul 13 05:45:41 li91-222 mysqld[17063]: 100713 5:45:41 InnoDB: Started; log sequence number 0 43655
Jul 13 05:45:41 li91-222 mysqld[17063]: 100713 5:45:41 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
Jul 13 05:45:41 li91-222 mysqld[17063]: 100713 5:45:41 [ERROR] Do you already have another mysqld server running on port: 3306 ?
Jul 13 05:45:41 li91-222 mysqld[17063]: 100713 5:45:41 [ERROR] Aborting
Jul 13 05:45:41 li91-222 mysqld[17063]:
Jul 13 05:45:41 li91-222 mysqld[17063]: 100713 5:45:41 InnoDB: Starting shutdown...
Jul 13 05:45:42 li91-222 mysqld[17063]: 100713 5:45:42 InnoDB: Shutdown completed; log sequence number 0 43655
Jul 13 05:45:42 li91-222 mysqld[17063]: 100713 5:45:42 [Note] /usr/sbin/mysqld: Shutdown complete
So, something about not being able to bind to the port, got it. But I'm pretty sure nothing else is running on port 3306, especially not mysqld. So that error message is a bit misleading.
After some searching around, I found someone who reported they had this same problem when their loopback device wasn't started up properly. Sounded weird, but I checked (ifconfig) and...no loopback device. Next step, ifup lo. Didn't work. So I checked /etc/network/interfaces. It looked like this:
auto lo
iface lo inet loopback
pre-up iptables-restore < /iptables.conf
auto eth0
iface eth0 inet dhcp
So, what was the problem? iptables.conf didn't exist. Solution: create it, comment out the line, or remove the line. Then run ifup lo again.
This problem seems to stem from when I restarted my Linode server for the first time ever in order to take advantage of their big free increase in RAM. (It's now $19.95/month for 512MB.)
What's my password?
I hadn't had to touch the database in quite a while (obviously, since I did not even know it was down), so I completely forgot the password. Seems like quite a problem, doesn't it? Well, it turns out resetting any MySQL password is actually really easy. Almost too easy, to be honest.
The instructions are here.
Comments [0]