Update :
I know how can terminate process or restart mysql Manually , but I want know why this problem happen and why service mysql restart not work ? and how can resolve this problem basically
I move all our user database to new mysql server (Remote mysql server) after start mysql server we can not restart it .
please see following :
root@mysql [~]# service mysql restart
Shutting down
MySQL........................................................................................................................................
.............................................................................
............................................................................. ....... ERROR!
ERROR! Failed to stop running server, so refusing to try to start.
and then mysql version not run :
root@mysql [~]# mysqladmin version
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
and you can see mysql process exist :
root@mysql [~]# ps aux | grep mysql
root 729300 0.0 0.0 11308 1504 ? S 09:45 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/mysql/mysql/ --pid-file=/mysql/mysql//mysql.shosting.net.pid
mysql 729861 100 22.4 42457756 11070156 ? Sl 09:45 270:45 /usr/sbin/mysqld --basedir=/usr --datadir=/mysql/mysql/ --plugin-dir=/usr/lib64/mysql/plugin --user=
mysql --log-error=/mysql/mysql//mysql.shosting.net.err --open-files-limit=1024000 --pid-file=/mysql/mysql//mysql.shosting.net.pid
and check log :
2015-07-13 13:59:51 729861 [Note] /usr/sbin/mysqld: Normal shutdown
2015-07-13 13:59:51 729861 [Note] Giving 43 client threads a chance to die gracefully
2015-07-13 13:59:51 729861 [Note] Event Scheduler: Purging the queue. 0 events
2015-07-13 13:59:51 729861 [Note] Shutting down slave threads
2015-07-13 13:59:53 729861 [Note] Forcefully disconnecting 42 remaining clients
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 482 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 499 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 642 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 661 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 678 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 713 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 730 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 747 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 764 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 784 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 801 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 870 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 889 user: 'root'
2015-07-13 13:59:53 729861 [Warning] /usr/sbin/mysqld: Forcing close of thread 836 user: 'root'
before restart i see following query in server :
+-----+------+-----------+--------------------+---------+------+----------------------+-----------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------+--------------------+---------+------+----------------------+-----------------------------------------------------+
| 178 | root | localhost | information_schema | Query | 763 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' |
| 295 | root | localhost | information_schema | Query | 463 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' |
| 411 | root | localhost | information_schema | Query | 163 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' |
| 465 | root | localhost | information_schema | Sleep | 33 | | |
| 476 | root | localhost | | Query | 0 | init | show processlist |
+-----+------+-----------+--------------------+---------+------+----------------------+-----------------------------------------------------+
How can resolve this issue ?
Thanks