简体   繁体   English

MySQL数据库引擎:MyISAM用于information_schema,而InnoDB用于其他数据库

[英]MySQL database engine: MyISAM for information_schema but InnoDB for other databases

I am currently using InnoDB for all my databases in MySQL, however I just noticed that my information_schema database uses MyISAM for tables that are not MEMORY. 我目前正在对MySQL中的所有数据库使用InnoDB,但是我只是注意到我的information_schema数据库对不是MEMORY的表使用MyISAM。

I am in the process of investigating an InnoDB/MyISAM issue. 我正在调查InnoDB / MyISAM问题。 While I don't think this is the cause of it, I am worried about this mixing. 虽然我不认为这是造成这种情况的原因,但我担心这种混合。 The database was originally set up with MyISAM. 该数据库最初是使用MyISAM建立的。 Later the my.cnf file was updated to reset the engine to InnoDB. 后来更新了my.cnf文件,以将引擎重置为InnoDB。 I am using MySQL 5.5.10. 我正在使用MySQL 5.5.10。

What are the possible issues that could occur with having your information_schema database set to MyISAM, but all your other databases set to MySQL? 将information_schema数据库设置为MyISAM,而将所有其他数据库设置为MySQL,可能会发生什么问题?


For those looking for help: If you came across this question in search of an answer or you want to know more, to see your default database engine: 对于那些寻求帮助的人:如果您在寻找答案时遇到了这个问题,或者想了解更多,请查看默认的数据库引擎:

show variables;

To see the engine assigned to tables in a database: 要查看分配给数据库中表的引擎:

show table status;

My my.cnf settings: 我的my.cnf设置:

[client]
default-character-set=utf8

[mysqld]
log=/usr/local/var/mysql/mysqld.log
character-set-server = utf8
collation-server = utf8_general_ci
lower_case_table_names=2
default_storage_engine=InnoDB

# Performance hacks:
innodb_flush_method=nosync
innodb_flush_log_at_trx_commit=0

The storage engine used is on a per-table basis. 使用的存储引擎基于每个表。 The default storage engine is used when creating a new table and you don't specify a storage engine for the new table. 创建新表时使用默认存储引擎,而您没有为新表指定存储引擎。

The system tables would have been MyISAM regardless of what you set the default storage engine to. 无论您将默认存储引擎设置为什么,系统表都将是MyISAM。

From MySQL documentation : MySQL文档

Important 重要

Do not convert MySQL system tables in the mysql database (such as user or host) to the InnoDB type. 请勿将mysql数据库(例如用户或主机)中的MySQL系统表转换为InnoDB类型。 This is an unsupported operation. 这是不受支持的操作。 The system tables must always be of the MyISAM type. 系统表必须始终为MyISAM类型。

If you are not querying the information_schema tables directly, there is no concern about mixing the types. 如果您不是直接查询information_schema表,则无需担心混合类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM