The mysql client
How can we run SQL statements that are inside a text file?
- Connect to mysql as we normally do
- \. khaisql.txt
How can we tell the mysql client to ignore cache?
Try using the SQL_NO_CACHE (MySQL 5.7) option in your query:
SELECT SQL_NO_CACHE * FROM TABLE
Any reference to current date/time will disable the query cache for that selection:
SELECT *,NOW() FROM TABLE
How can we execute a SQL statement from the command line?
mysql -u user -p -e 'YOUR_SQL_STATEMENT' databaseName
How can we display the load on the server?
Connect to the MySQL server as we normally do with the mysql client, and then:
SHOW GLOBAL STATUS;
See also:
- http://jeremy.zawodny.com/mysql/mytop/ ( perfect for non-admin users )
- http://www.tecmint.com/mysql-performance-monitoring/
page revision: 4, last edited: 22 Sep 2017 22:05