Posts under MySQL Database

How to monitor sql query in mysql?

advertisement

mysql logoMonitor what sql query is running in mysql is very import for performance analysis. By monitor sql query, you are be able to know what is running at the backend. if your framework logs all sql queries then you can monitor from there, if not, you might need to turn on mysql log to monitor all the sql query being executed.

To monitor sql query in MySQL, simply follow the steps below:-

Continue reading How to monitor sql query in mysql? »

Turn on MySQL query cache to speed up query performance?

advertisement

Many times developers looking for ways to speed up query, in mysql we can enable query cache to speed up query performance. Whenever query cache is enable, it will cache the query in memory and boost query performance.

As we know, speed is always the most important element in developing a website especially for those high traffic database driven website. You can try to turn on query cache to speed up query.

To speed up query, enable the MySQL query cache, before that you need to set few variables in mysql configuration file (usually is my.cnf or my.ini)

Continue reading Turn on MySQL query cache to speed up query performance? »

How to backup MySQL Database in command line with compression

advertisement

For those who looking for way to backup mysql database,
you can use mysqldump to backup mysql database.

Below is the script example to backup mysql database in command line:-

$ mysqldump -h localhost -u username -p database_name > backup_db.sql

If your mysql database is very big, you might want to compress your sql file.
Just use the mysql backup command below and pipe the output to gzip,
then you will get the output as gzip file.

Continue reading How to backup MySQL Database in command line with compression »