您的位置:首页 > 数据库 > MySQL

Mysql开启InnoDB引擎

2016-07-13 13:15 766 查看

mysql命令行查看InnoDB引擎是否支持

mysql> show engines;

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| MyISAM             | DEFAULT | MyISAM storage engine                                          | NO           | NO   | NO         |

| CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         |

| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |

| BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |

| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |

| FEDERATED          | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |

| ARCHIVE            | YES     | Archive storage engine                                         | NO           | NO   | NO         |

| PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         |

| InnoDB             | NO     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

9 rows in set (0.00 sec)


如果InnoDB显示为NO,一般是两种可能:1、安装mysql时没有选择InnoDB,这种情况处理比较麻烦,这里不讨论。2、安装了InnoDB但没有开启,这是我们今天讨论的

在mysql配置文件中开启InnoDB

[vagrant@web ~]$ sudo vim  /usr/local/mysql/my.cnf


加入innodb = on



重启mysql服务即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql InnoDB