SoFunction
Updated on 2024-11-15

mysql database modify data table engine method

For MySQL databases, you must use the INNODB engine if you want to use transactions and row-level locking. If you want to use full-text indexing, you must use myisam. INNODB is more useful, secure, and stable but less efficient than MYISAM, but there are features that MYISAM does not have. Modify the engine of MySQL to INNODB, you can use foreign keys, transactions and other features, high performance.

Viewing the status of a data table

Copy Code The code is as follows.

SHOW TABLE STATUS FROM sites WHERE NAME='site'; 
SHOW TABLE STATUS FROM db_name WHERE NAME='table_name'; 
 

Changing the engine of a table

Copy Code The code is as follows.

alter table table_name engine=innodb; 
alter table table_name engine=myisam;