12/05/2009
mysql not starting
comzeradd send me an e-mail about a mysql service not starting in a server we administer. I started taking a look around…nothing seemed suspicious.
I tried uninstalling and re-installing mysql-server-5.0 a few times and I always got this kind of output from apt-get:
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action “start” failed.
dpkg: error processing mysql-server-5.0 (–configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.0
Reading package lists… Done
Building dependency tree
Reading state information… Done
Reading extended state information
Initializing package states… Done
Reading task descriptions… Done
Reconfiguring the package just prompted me to input a new root password, still it could not start. Here’s what the syslog output looked like:
May 12 16:19:56 foo mysqld_safe[24776]: started
May 12 16:19:56 foo mysqld[24779]: 090512 16:19:56 InnoDB: Started; log sequence number 0 43655
May 12 16:19:56 foo mysqld[24779]: 090512 16:19:56 [ERROR] Can’t start server: Bind on TCP/IP port: Cannot assign requested addr
ess
May 12 16:19:56 foo mysqld[24779]: 090512 16:19:56 [ERROR] Do you already have another mysqld server running on port: 3306 ?
May 12 16:19:56 foo mysqld[24779]: 090512 16:19:56 [ERROR] Aborting
May 12 16:19:56 foo mysqld[24779]:
May 12 16:19:56 foo mysqld[24779]: 090512 16:19:56 InnoDB: Starting shutdown…
May 12 16:19:58 foo mysqld[24779]: 090512 16:19:58 InnoDB: Shutdown completed; log sequence number 0 43655
May 12 16:19:58 foo mysqld[24779]: 090512 16:19:58 [Note] /usr/sbin/mysqld: Shutdown complete
May 12 16:19:58 foo mysqld[24779]:
May 12 16:19:58 foo mysqld_safe[24816]: ended
But there was no other mysql server running. I then typed ifconfig and here’s the output:
lo Link encap:Local Loopback
LOOPBACK MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
The loopback did not have an IP address!!!
I looked inside mysql’s my.cnf and mysqld had
bind-address = 127.0.0.1
The command:
ifconfig lo 127.0.0.1
fixed the problem 🙂
Filed by kargig at 19:35 under Linux
Tags: bind-address, debian, init, Linux, loopback, mysql
2 Comments | 4,939 views
It seems like you lack a “lo” statement in your /etc/network/interfaces 😉
auto lo
iface lo inet loopback
Adding these two lines should give you a nicely configured lo on boot 🙂
Cheers, mate!
Troll detected