MySQL run command via command line


To run mysql commands via linux command line. Append -e and the command that you need to run.

mysql -u root -p -e 'SHOW PROCESSLIST\G;' | grep row | tail -1

Advertisements