MySQL Import error error 1286 (42000) at line 1:unknown table engine ' InnoDB '

Source: Internet
Author: User
Tags sql error mysql import

[[email protected] mysql]# mysql-u root-p ' 123456 ' Jiang < schema.sql ERROR 1286 (42000) at line 1:un Known table engine ' InnoDB '
mysql> select * from 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)

First look at this table there is no

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

If not, install the InnoDB plugin

You can use show engines, or show plugins;

mysql> show plugins;+------------+--------+----------------+---------+---------+| name        | Status | Type            | library | license |+------------+--------+----------------+----- ----+---------+| binlog     | active | storage engine |  null    | gpl     | |  csv        | active | storage engine |  null    | gpl     | |  MEMORY     | ACTIVE | STORAGE ENGINE | NULL     | gpl     | |  mrg_myisam | active | storage engine | null    |  gpl     | |  MyISAM     | ACTIVE | STORAGE ENGINE | NULL     | gpl     |+------------+--------+----------------+---------+- --------+5 rows in set  (0.00&NBSP;SEC)

Method One:
When configure, add –with-plugins=innobase (or all) if you want to add multiple plugins, separated by a comma with a half-width

Method Two:
If MySQL has been compiled, and do not want to recompile, you can install plug-ins, InnoDB is a plug-in, installed after MySQL can also be added.

1, check that MySQL configuration is not supported dynamically add plugins

Mysql> Show variables like "have_%", +----------------------+-------+| variable_name | Value |+----------------------+-------+| have_compress | YES | | Have_crypt | YES | | Have_csv | YES | | have_dynamic_loading |    YES | Here is the Yes expression is supported


If it is no, it is not very good, because have_dynamic_loading is a read-only variable,

Mysql> set have_dynamic_loading=1; ERROR 1238 (HY000): Variable ' have_dynamic_loading ' is a read only Variable

But normally it's yes,

2, add plugin

mysql> INSTALL PLUGIN INNODB SONAME ' ha_innodb.so ';

Prompt cannot open file, no permission

Locate the/lib/mysql/plugin directory under the installation directory and run the following command:

@ubuntu:/usr/local/mysql# chcon-t texrel_shlib_t/usr/local/mysql/lib/mysql/plugin/ha_innodb.so


In fact, with the LL command to see, you can find ha_innodb.so is ha_innodb.so.0.0.0 link, it is not possible to do so:

Install plugin INNODB soname "ha_innodb.so.0.0.0";


Install the following several

mysql> install plugin innodb soname  "Ha_ innodb_plugin.so.0.0.0 ";mysql> install plugin innodb_trx soname " ha_innodb_ plugin.so.0.0.0 ";mysql> install plugin innodb_locks soname " ha_innodb_ plugin.so.0.0.0 ";mysql> install plugin innodb_lock_waits soname " ha_innodb_ plugin.so.0.0.0 ";mysql> install plugin innodb_cmp soname " ha_innodb_ plugin.so.0.0.0 ";mysql> install plugin innodb_cmp_reset soname " ha_innodb_ plugin.so.0.0.0 ";mysql> install plugin innodb_cmpmem soname " ha_innodb_ plugin.so.0.0.0 ";mysql> install plugin innodb_cmpmem_reset soname " ha_innodb_ plugin.so.0.0.0 "; 


Some of the above commands I see some people quoted the package is ha_innodb.so, but I executed will say can not find Innodb_trx, I think it will not be in this bag, so instead of ha_innodb_plugin.so this package can be.

After installation, use show engines; or show plugins; to see

mysql> show plugins;+---------------------+--------+--------------------+---------+---------+|  name                |  Status | Type                | library | license |+---------------------+--------+--------------------+---- -----+---------+| binlog               | ACTIVE | STORAGE ENGINE     | NULL     | gpl     | |  CSV                  | ACTIVE | STORAGE ENGINE     | NULL     | gpl     | |  memory              | active | storage engine      | null    | gpl     | |  innodb              | active  | storage engine     | null    | gpl      | |  INNODB_TRX          | ACTIVE |  information schema | null    | gpl     | |  INNODB_LOCKS        | ACTIVE | INFORMATION  schema | null    | gpl     | |  innodb_lock_waits   | active | information schema | null     | gpl     | |  INNODB_CMP          | ACTIVE |  information schema | null    | gpl     | |  INNODB_CMP_RESET    | ACTIVE | INFORMATION SCHEMA |  null    | gpl     | |  innodb_cmpmem       | active | information schema  | null    | gpl     | |  INNODB_CMPMEM_RESET | ACTIVE | INFORMATION SCHEMA | NULL     | gpl     | |  mrg_myisam          | active | storage  ENGINE     | NULL    | GPL      | | myisam              |  active | storage engine     | null    |  gpl     |+---------------------+--------+--------------------+---------+---------+13  rows in set  (0.00 sec



MySQL Import error error 1286 (42000) at line 1:unknown table engine ' InnoDB '

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.