I'm having trouble restarting the mysql service
[root ~]# service mysqld restart
Stopping MySQL: [FAILED]
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]
From the mysqld.log
131004 10:34:49 mysqld started
131004 10:34:52 InnoDB: Started; log sequence number 0 43655
131004 10:34:52 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
131004 10:34:52 [ERROR] Do you already have another mysqld server running on port: 3306 ?
131004 10:34:52 [ERROR] Aborting
131004 10:34:52 InnoDB: Starting shutdown...
131004 10:34:54 InnoDB: Shutdown completed; log sequence number 0 43655
131004 10:34:54 [Note] /usr/libexec/mysqld: Shutdown complete
131004 10:34:54 mysqld ended
Processes
# ps -Af | grep mysql
root 24965 1 0 08:39 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --user=mysql
mysql 25018 24965 43 08:39 ? 00:57:11 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --open-files-limit=65535 --socket=/var/lib/mysql/mysql.sock
root 27960 27143 0 10:50 pts/0 00:00:00 grep mysql
It almost seems like there's 2 mysqlds running, one of them zombie. How can I fix this?
try
to find the other mysqld running and then kill it.
try
sudo netstat -lntup
and look for port 3306, if MySQL is still listening that means it was not killed, use the kill command as suggested in other comments and check the init scripts to see why is it not stopping MySQL.Generally when you can't stop mysql it's due to not being able to shut it down via mysqladmin.. Run the following to see if it shuts down
If that doesn't work then you need to set the password for it in the init script or the /root/.my.cnf file or another my.cnf file.
Reboot your VM or server, the zombie mysql should not start then.