Mysql not restart
Hello :
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 :
and then mysql version not run :
and you can see mysql process exist :
and check log :
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.pidand 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'-
How can resolve this issue ? 0 -
The problem is that MySQL isn't shutting down in order to restart. The init script has a timeout so even though you see ERROR in the output, MySQL is still actually shutting down. Tail the log while it's shutting down and wait for it to finish, then initiate a start. If you get really impatient, you can kill the PID - but that can be dangerous so I don't recommend it. It's also unusual that it would take this long to stop unless you have an insanely busy MySQL server. Usually InnoDB is the culprit, so try this: 0 -
before restart i see following query in server : SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' with too much ruining time. 0 -
then kill the query. 0 -
what is this process ? this query cause mysql slow and problem to restart . +------+------+-----------+--------------------+---------+------+----------------------+-----------------------------------------------------+ | Id | User | Host | db | Command | Time | State | Info | +------+------+-----------+--------------------+---------+------+----------------------+-----------------------------------------------------+ | 648 | root | localhost | information_schema | Query | 6815 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 767 | root | localhost | information_schema | Query | 6514 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 883 | root | localhost | information_schema | Query | 6215 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 1063 | root | localhost | information_schema | Query | 5915 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 1178 | root | localhost | information_schema | Query | 5615 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 1294 | root | localhost | information_schema | Query | 5316 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 1412 | root | localhost | information_schema | Query | 5016 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 1526 | root | localhost | information_schema | Query | 4714 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 1642 | root | localhost | information_schema | Query | 4415 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 1757 | root | localhost | information_schema | Query | 4115 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 1875 | root | localhost | information_schema | Query | 3816 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 2000 | root | localhost | information_schema | Query | 3515 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 2116 | root | localhost | information_schema | Query | 3215 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 2233 | root | localhost | information_schema | Query | 2916 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 2349 | root | localhost | information_schema | Query | 2615 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 2519 | root | localhost | information_schema | Query | 2315 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 2637 | root | localhost | information_schema | Query | 2015 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 2753 | root | localhost | information_schema | Query | 1715 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 2872 | root | localhost | information_schema | Query | 1415 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 2996 | root | localhost | information_schema | Query | 1115 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 3113 | root | localhost | information_schema | Query | 815 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 3229 | root | localhost | information_schema | Query | 515 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 3344 | root | localhost | information_schema | Query | 215 | checking permissions | SELECT count(*) FROM tables WHERE ENGINE = 'InnoDB' | | 3420 | root | localhost | information_schema | Sleep | 24 | | | | 3428 | root | localhost | | Query | 0 | init | show processlist | +------+------+-----------+--------------------+---------+------+----------------------+-----------------------------------------------------+0 -
Hello :) You can try disabling the following option under the "SQL" tab in "WHM >> Tweak Settings" to see if it helps: "Use INFORMATION_SCHEMA to acquire MySQL disk usage" Per it's description: Quote Using INFORMATION_SCHEMA ensures that disk usage by MySQL tables is included in totals. However, enabling this option may cause a significant drop in performance as MySQL may become unresponsive until data collection is complete. Disabling this option causes the system to query the filesystem directly, potentially excluding disk space used by some database tables. Note: If you use a remote MySQL server, you must turn this setting On in order to calculate MySQL disk usage. Thank you. 0 -
Hello : even after disabling problem not resolved. 0 -
Hello : even after disabling problem not resolved.
Could you elaborate? For instance, do you still see the same output when running the "mysqladmin processlist" command? Thank you.0
Please sign in to leave a comment.
Comments
8 comments