天天看点

让mysql支持innodb

default-storage-enginie=innodb'

让mysql支持innodb

用源码 包安装mysql 5.1.34 发现show engines;里没有innodb

cp /data/mysql/share/mysql/my-innodb-heavy-4G.cnf    到/etc/my.cnf

删除mysql数据目录里的删除ibdata1、ib_logfile1、 ib_logfile0 等文件,然后,重启mysql

每一次会出错,在重启一次就OK了

.

mysql> show engines;

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

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

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

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

| MyISAM            | DEFAULT | Default engine as of MySQL 3.23 with great performance      | 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         |

5 rows in set (0.00 sec)

让mysql默认存储引擎为Innodb

修改/etc/my.cnf

[mysqld]

default-storage-enginie=innodb

然后重启mysql数据库

./mysqladmin shutdown

./mysqld_safe &

mysql> show engines;

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

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

| MyISAM     | YES     | Default engine as of MySQL 3.23 with great performance     | NO           | NO   | NO         |

| InnoDB     | DEFAULT | 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         |

进入mysql 用show engines;如上图所示,Innodb已经支持了