Database Will Not Start

Issue:

The NexOSS application cannot connect to the database. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. The MySql database will not start.

Log message:

[root@nexoss rc3.d]# service mysqld restart
Stopping mysqld: [ OK ]
Another MySQL daemon already running with the same unix socket.
Starting mysqld: [FAILED]
[root@nexoss rc3.d]#
2013-12-24 16:52:21|CDRPull |INFO |Waiting for 2 seconds
2013-12-24 16:52:23|CDRPull |ERROR |SQLException: Failed to connect to jdbc:mysql://localhost/mysqldb as ossadmin and rapidtel
java.sql.SQLException: Failed to connect to jdbc:mysql://localhost/mysqldb as ossadmin and rapidtel
 
at com.transnexus.Mediation.goMediate(Mediation.java:290)
at com.transnexus.Monitor.run(Monitor.java:126)
at java.lang.Thread.run(Thread.java:662)

Troubleshoot:

If you try to start it manually, you will see a message stating that “Another MySQL daemon already running with the same unix socket.”

Solution:

Remove the myssql.sock file and then execute the restart command again.

[root@nexoss mysql]# pwd
/var/lib/mysql
 
[root@nexoss mysql]# ls -ltr
total 2600980
drwx++++++ 2 mysql mysql 4096 Dec 19 22:44 mysql
srwxrwxrwx 1 mysql mysql 0 Dec 19 22:53 mysql.sock
drwx++++++ 2 mysql mysql 4096 Dec 19 23:43 mysqldb
-rw-rw+++- 1 mysql mysql 262144000 Dec 24 12:17 ib_logfile1
-rw-rw+++- 1 mysql mysql 2139095040 Dec 24 12:17 ibdata1
-rw-rw+++- 1 mysql mysql 262144000 Dec 24 12:17 ib_logfile0
 
[root@nexoss mysql]# rm mysql.sock
rm: remove socket `mysql.sock'? y
 
[root@nexoss mysql]# ls -l
total 2600980
-rw-rw+++- 1 mysql mysql 2139095040 Dec 24 12:17 ibdata1
-rw-rw+++- 1 mysql mysql 262144000 Dec 24 12:17 ib_logfile0
-rw-rw+++- 1 mysql mysql 262144000 Dec 24 12:17 ib_logfile1
drwx++++++ 2 mysql mysql 4096 Dec 19 22:44 mysql
drwx++++++ 2 mysql mysql 4096 Dec 19 23:43 mysqldb
 
[root@nexoss mysql]# service mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
[root@nexoss mysql]#