标签归档:mysql

mysql innodb引擎安装办法

进入mysql 命令行:mysql -uroot -p

输入密码

查看是否存在innode引擎。

mysql> show engines;
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                    | Transactions | XA   | Savepoints |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
| CSV        | YES     | CSV storage engine                                         | 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         |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                      | NO           | NO   | NO         |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
5 rows in set (0.00 sec)

查看是否有InnoDB。

如果不存在查看是否有innoDB

mysql> SHOW variables like "have_%";
+-------------------------+----------+
| Variable_name           | Value    |
+-------------------------+----------+
| have_community_features | YES      |
| have_compress           | YES      |
| have_crypt              | YES      |
| have_csv                | YES      |
| have_dynamic_loading    | YES      |
| have_geometry           | YES      |
| have_innodb             | YES      |
| have_ndbcluster         | NO       |
| have_openssl            | DISABLED |
| have_partitioning       | NO       |
| have_query_cache        | YES      |
| have_rtree_keys         | YES      |
| have_ssl                | DISABLED |
| have_symlink            | YES      |
+-------------------------+----------+
14 rows in set (0.00 sec)

显示结果中会有如下3种可能的结果:

have_innodb YES
have_innodb NO
have_innodb DISABLED
这3种结果分别对应:

已经开启InnoDB引擎
未安装InnoDB引擎
未启用InnoDB引擎

如果需要安装InnoDB引擎,需要如下操作:

查看插件目录

mysql> SHOW variables like "plugin_dir";
+---------------+--------------------------------------------+
| Variable_name | Value                                      |
+---------------+--------------------------------------------+
| plugin_dir    | /usr/local/mysql-5.1.69/lib/mysql/plugin |
+---------------+--------------------------------------------+
1 row in set (0.00 sec)

进入插件目录
查找是否已经存在innodb的so
从步骤二中查看是否已经存在innodb的so
如果不存在 则从mysql的安装结构中将innodb so拷贝到plugins_dir目录中

安装innodb

mysql> install plugin innodb soname "ha_innodb.so";

至此输入命令

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         |
+------------+---------+------------------------------------------------------------+--------------+------+------------+
5 rows in set (0.00 sec)

如果出现InnoDB为yes,即安装成功。

本文已经被查看657次