gpt4 book ai didi

sql - 如何确定 mysql 数据库的类型 : whether it is InnoDB or MyISAM?

转载 作者:IT老高 更新时间:2023-10-28 23:46:27 25 4
gpt4 key购买 nike

  • 如何确定 mysql 数据库的类型:是 InnoDB 还是 MyISAM?
  • 如何将 MyISAM 转换为 InnoDB,反之亦然?

最佳答案

要确定表正在使用的存储引擎,您可以使用show table status .结果中的 Engine 字段将显示表的数据库引擎。或者,您可以从 information_schema.tables 中选择 engine 字段:

select engine 
from information_schema.tables
where table_schema = 'schema_name'
and table_name = 'table_name'

您可以使用 alter table 在存储引擎之间切换:

alter table the_table engine = InnoDB;

当然,您可以在其中指定任何可用的存储引擎。

关于sql - 如何确定 mysql 数据库的类型 : whether it is InnoDB or MyISAM?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1638070/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com