Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine whether InnoDB plugin is installed in MySQL

Tags:

mysql

How do we check Innodb plugin is installed or not in MySQL? Is there any variable to check Innodb Plugin is installed or not?

like image 457
Sandy Avatar asked May 09 '12 13:05

Sandy


People also ask

How do I know if I have MySQL InnoDB?

The easiest way to check whether the InnoDB engine is enabled is to log in to phpMyAdmin, click the SQL tab, type the following command in the box: show engines; and click Go to execute the query and see the available storage engines. Next to InnoDB engine, in the Support row you will see Yes if InnoDB is enabled.

Where can I find InnoDB in MySQL?

You can view a list of InnoDB INFORMATION_SCHEMA tables by issuing a SHOW TABLES statement on the INFORMATION_SCHEMA database: mysql> SHOW TABLES FROM INFORMATION_SCHEMA LIKE 'INNODB%'; For table definitions, see Section 26.4, “INFORMATION_SCHEMA InnoDB Tables”.


1 Answers

If you need to determine whether or not InnoDB is enabled by querying the database, you should use the INFORMATION_SCHEMA tables.

SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE = 'InnoDB';

Which, if InnoDB is enabled and is the default database, gives a result of

+---------+
| SUPPORT |
+---------+
| DEFAULT |
+---------+

If InnoDB is available, but not the default engine, the result will be YES. If it's not available, the result will obviously be NO.

Please see http://dev.mysql.com/doc/refman/5.5/en/engines-table.html and http://dev.mysql.com/doc/refman/5.5/en/information-schema.html for reference.

When InnoDB is available, the INFORMATION_SCHEMA tables you mentioned in a comment are also available.

SHOW TABLES FROM INFORMATION_SCHEMA LIKE 'INNODB%';

+----------------------------------------+
| Tables_in_INFORMATION_SCHEMA (INNODB%) |
+----------------------------------------+
| INNODB_CMP_RESET                       |
| INNODB_TRX                             |
| INNODB_CMPMEM_RESET                    |
| INNODB_LOCK_WAITS                      |
| INNODB_CMPMEM                          |
| INNODB_CMP                             |
| INNODB_LOCKS                           |
+----------------------------------------+
like image 190
Ketola Avatar answered Oct 03 '22 10:10

Ketola