How to understand Unknown storage engine & # 039 in ERROR
How to understand the Unknown storage engine 'MyISAM' in ERROR, I believe many inexperienced people are helpless about this, for this reason this article summarizes the causes and solutions of the problem, through this article I hope you can solve this problem.
I. Error demonstration
As follows:
root@localhost:test:09:49:03>create table ttt(id int) engine=myisam ;ERROR 1286 (42000): Unknown storage engine 'MyISAM'
enforce_storage_engine: Create a table to check whether the engine meets the set engine value.
sql_mode (NO_ENGINE_SUBSTITUTION): Make comprehensive judgment according to the previous check values. If NO_ENGINE_SUBSTITUTION is set, an error will be reported. If NO_ENGINE_SUBSTITUTION is not set, it will be performed, and the engine of the new table will be changed to the engine set by enforce_storage_engine.
In our environment, enforce_storage_engine is set to Innodb, and NO_ENGINE_SUBSTITUTION is set in sql_mode.
III. Correlation function
check_engine
->ha_enforce_handlerton
Part of the logic is as follows:
Engine check according to ha_enforce_handlerton function, mainly check whether the value set by enforce_storage_engine parameter is a known engine. Otherwise, the error Unknown storage engine is reported, and the return value is the engine specified by force_storage_engine (such as Innodb).
Judge according to the return value above
If the engine specified in the table (such as MyISAM here) is different from the engine set by enforce_storage_engine (such as Innodb here), and sql_mode sets NO_ENGINE_SUBSTITUTION. ERROR 1286 (42000): Unknown storage engine 'MyISAM', which is also the current error.
If sql_mode NO_ENGINE_SUBSTITUTION is not set, the engine value specified in the table creation statement is replaced with the value specified by enforce_storage_engine (for example, Innodb instead of MyISAM), and a warning, ER_WARN_USING_OTHER_HANDLER, is reported. The output is the new engine value.
IV. Modifications
Cancel the enforce_storage_engine parameter.
Stack #0 check_engine (thd=0x7fffe400a8a0, db_name=0x7fffe40108f0 "test", table_name=0x7fffe4010328 "ttt", create_info=0x7fffe8ecd890, alter_info=0x7fffe8ecd300) at /cdh/mysqldebug/percona-server-5.7.29-32/sql/sql_table.cc:11318#1 0x000000000155d81e in create_table_impl (thd=0x7fffe400a8a0, db=0x7fffe40108f0 "test", table_name=0x7fffe4010328 "ttt", error_table_name=0x7fffe4010328 "ttt", path=0x7fffe8eccf60 "./ test/ttt", create_info=0x7fffe8ecd890, alter_info=0x7fffe8ecd300, internal_tmp_table=false, select_field_count=0, no_ha_table=false, is_trans=0x7fffe8ecd1ee, key_info=0x7fffe8ecd170, key_count=0x7fffe8ecd16c) at /cdh/mysqldebug/percona-server-5.7.29-32/sql/sql_table.cc:5138#2 0x000000000155f352 in mysql_create_table_no_lock (thd=0x7fffe400a8a0, db=0x7fffe40108f0 "test", table_name=0x7fffe4010328 "ttt", create_info=0x7fffe8ecd890, alter_info=0x7fffe8ecd300, select_field_count=0, is_trans=0x7fffe8ecd1ee) at /cdh/mysqldebug/percona-server-5.7.29-32/sql/sql_table.cc:5753#3 0x000000000155f47a in mysql_create_table (thd=0x7fffe400a8a0, create_table=0x7fffe4010368, create_info=0x7fffe8ecd890, alter_info=0x7fffe8ecd300) at /cdh/mysqldebug/percona-server-5.7.29-32/sql/sql_table.cc:5801#4 0x00000000014cc36d in mysql_execute_command (thd=0x7fffe400a8a0, first_level=true) at /cdh/mysqldebug/percona-server-5.7.29-32/sql/sql_parse.cc:3510#5 0x00000000014d2e1b in mysql_parse (thd=0x7fffe400a8a0, parser_state=0x7fffe8ece4a0, update_userstat=false) at /cdh/mysqldebug/percona-server-5.7.29-32/sql/sql_parse.cc:5927#6 0x00000000014c7a55 in dispatch_command (thd=0x7fffe400a8a0, com_data=0x7fffe8ecec90, command=COM_QUERY) at /cdh/mysqldebug/percona-server-5.7.29-32/sql/sql_parse.cc: 1539#7 0x00000000014c688a in do_command (thd=0x7fffe400a8a0) at /cdh/mysqldebug/percona-server-5.7.29-32/sql/sql_parse.cc:1060#8 0x00000000015fab28 in handle_connection (arg=0x3c4f150) at /cdh/mysqldebug/percona-server-5.7.29-32/sql/conn_handler/connection_handler_per_thread.cc:325#9 0x00000000018cad34 in pfs_spawn_thread (arg= 0x3c 568b0) at /cdh/mysqldebug/percona-server-5.7.29-32/storage/perfschema/pfs.cc:2198#10 0x00007 ffff7bc6e65 in start_thread () from /lib64/libpthread.so.0#11 0x0007 ffff5fa088d in clone () from /lib64/libc.so.6 After reading the above, do you know how to understand Unknown storage engine 'MyISAM' in ERROR? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!