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

前端 未结 6 657
不知归路
不知归路 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:53

    SHOW TABLE STATUS FROM `database`;
    

    will list everything for all tables, starting with whether they are MyISAM or InnoDB. if you desire to list only data regarding 1 table, the syntax below may be used* :

    SHOW TABLE STATUS FROM `database` LIKE 'table';
    

    to change the table engine:

    ALTER TABLE `table` ENGINE=InnoDB;
    

    *attention use the GRAVE ACCENT (` backtick) for the database name and the table name and the SINGLE QUOTE (') for the comparison string (portion of table name) after LIKE.

    ` != '

提交回复
热议问题