1

I have MySQL 5.0.27 running on a Linux server. It is consuming too many resources (it is running about 80 tasks loading a database). I am unable to log into the server to reduce the number of tasks because SSH, while accepting a password, will time out while requesting a new channel because of the system load.

Can I remotely send a shutdown command to the server? It is possible from another server to either use mysql or mysqladmin with a -h option or use MySQL workbench to shut the server down gracefully?

If I reboot the server I will need to repair two large tables (>200m records) which takes hours. I'd like to avoid this option.

0

2 Answers 2

2

You can send commands via ssh (that is you don't have to actually log in and run the command):

ssh user@host 'mysqladmin shutdown'
2
  • I can actually connect to the server using mysql -h IPADDR. But mysqladmin -h IPADDR just outputs the usage listing. It doesn't recognize the -h (or --host=IPADDR) command.
    – mlewis54
    Mar 16, 2013 at 16:01
  • mysqladmin -h IPADDR just outputs the usage listing, yes, but not because it doesn't recognize --host. The problem is, mysqladmin requires an actual command to be specified such as shutdown or status -- you can't just type "mysqladmin" (with or without options) and omit the actual thing you want mysqladmin to do. Mar 18, 2013 at 18:52
1

This should work.

mysqladmin shutdown

More at Here

4
  • it would work if I could log into the box.
    – mlewis54
    Mar 16, 2013 at 15:50
  • oh yeah,my bad.You can connect using MySQL bench ? if so,you can stop the server for there. '-h' should work! well you are sure you have the remote access right?
    – Yash
    Mar 16, 2013 at 16:11
  • see my last comment on the answer above. Mysqladmin -h is ignoring the command. I can connect using mysql bench, but remote access is SSH based and SSH can't connect. We're talking rock and hard place here.
    – mlewis54
    Mar 16, 2013 at 16:15
  • SSH can't connect .hmm, Sorry dude seems like major prob then I thought ! Lets hope some one solves this :) Good luck!
    – Yash
    Mar 16, 2013 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.