首页 » InnoDB引擎

InnoDB引擎

查看MySQL支持的引擎:

mysql> show engines;
+------------+---------+-----------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                   | Transactions | XA   | Savepoints |
+------------+---------+-----------------------------------------------------------+--------------+------+------------+
| CSV        | YES     | CSV storage engine                                        | NO           | NO   | NO         |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                     | NO           | NO   | NO         |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables | NO           | NO   | NO         |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance    | NO           | NO   | NO         |
+------------+---------+-----------------------------------------------------------+--------------+------+------------+
4 rows in set (0.00 sec)

查看下是否支持动态加载插件(同时也看到了不支持InnoDB):

mysql> show variables like 'have_%';
+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| have_dynamic_loading    | YES   |
| have_innodb             | NO    |

通常have_dynamic_loading都是YES,即支持动态加载。接下来就是加载InnoDB插件:

mysql> install plugin innodb soname 'ha_innodb.so';
Query OK, 0 rows affected (0.46 sec)

加载成功。再检查下:

mysql> show variables like 'have_%';
+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| have_dynamic_loading    | YES   |
| have_innodb             | YES   |

mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                    | Transactions | XA   | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| CSV        | YES     | CSV storage engine                                         | NO           | NO   | NO         |
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables  | NO           | NO   | NO         |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance     | NO           | NO   | NO         |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                      | NO           | NO   | NO         |
+------------+---------+------------------------------------------------------------+--------------+------+------------+

看起来是支持InnoDB了。

分享

0