How can I determine type of mysql database : whether it is InnoDB or MyISAM?

前端 未结 6 517
不知归路
不知归路 2021-01-31 17:08
  • How can I determine type of mysql database : whether it is InnoDB or MyISAM ?
  • How can I convert MyISAM to InnoDB or vice-versa ?
6条回答
  •  南笙
    南笙 (楼主)
    2021-01-31 17:54

    To determine the storage engine being used by a table, you can use show table status. The Engine field in the results will show the database engine for the table. Alternately, you can select the engine field from information_schema.tables:

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

    You can change between storage engines using alter table:

    alter table the_table engine = InnoDB;
    

    Where, of course, you can specify any available storage engine.

提交回复
热议问题