Linux/MySQL: Find all database using innodb engine

mysql

 

If you are the Linux administrator that using full backup of your account, you will find out that the MySQL database full backup couldn’t help to restore your database.

Hence, you might want to schedule a full mysqldump backup for those databases that using the innodb engine.

To show all of your databases that using innodb engine, you may use the following command,

# mysql -N mysql -e "SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE engine = 'innodb';" | awk '{print $1}' | sort | uniq

Disable Post revision in WordPress

Post revision is a nice tools if you have multiple writer who will contribute from the same article, but how if you have more than 5,000 articles and each time your writter will edit and draft it, you might have 50,000 records from your wp_posts tables where would slow down the database loading time.

To done this, simply add the code as below from wp_config.php file,

define('WP_POST_REVISIONS', false);

Display database result vertically

By default, database will showing the result according to the select entry in tables,

mysql> select * from wp_terms WHERE term_id='1';
+---------+----------+----------+------------+
| term_id | name     | slug     | term_group |
+---------+----------+----------+------------+
|       1 | Blogging | blogging |          0 |
+---------+----------+----------+------------+
1 row in set (0.00 sec)

Somehow, you could make them display in vertically.

mysql> select * from wp_terms WHERE term_id='1'\G;
*************************** 1. row ***************************
term_id: 1
name: Blogging
slug: blogging
term_group: 0
1 row in set (0.00 sec)

This could be done by just use the “\G” (without quotation) from the query.