MySQL's storage engine for viewing and modifying tables (transfer)

1 Check the storage engines supported by the system

   show engines;

 

2 View the storage engine used by the table

 Two methods:
 a. show table status from db_name where name='table_name';
 b. show create table table_name;
 if the displayed format is not good-looking, you can use \g instead of the semicolon at the end of the line.
 
 Some people say that the second method is inaccurate ( http://guaniuzhijia.blog.163.com/blog/static/16547206920114129953533/ )
 I tried it. After closing the original default Innodb engine, the show create table table_name command could not be executed at all, because the Innodb table was built before. After it is turned off, the MyISAM engine is used by default, which causes the Innodb table data to be unable to be read correctly.

 

3 Modify the table engine method
 alter table table_name engine=innodb;

 

4 Close the Innodb engine method
 Close the mysql service: net stop mysql
 Find the my.ini file in the mysql installation directory:
 find default-storage-engine=INNODB Change to default-storage-engine=MYISAM
 Find #skip-innodb Change to skip-innodb
 Start the mysql service: net start mysql

 

From: http://blog.csdn.net/shellching/article/details/8106156

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326078140&siteId=291194637