Yugal Jindle Yugal Jindle - 2 months ago 15
MySQL Question

How do I set MyISAM as default table handler in MySQL?

I want all my tables and the whole database to use MyISAM engine.

My Project uses MyISAM database exclusively.

I want the default table handler for all tables to be MyISAM.

Answer

UPDATE: InnoDB has been the default storage engine since MySQL 5.5.5. MyISAM is now legacy but still exists.

Also the default-table-type option was a synonym for default-storage-engine and was removed in MySQL 5.5. And, as of MySQL 5.6.3, default-storage-engine sets the storage engine for permanent tables only.


To see what your default storage engine currently is do: mysql> SHOW engines; MyISAM has long been the default, but someone might have changed it.

To change your default storage engine back to MyISAM, put

default-table-type=myisam

under the [mysqld] section in your my.cnf and restart mysqld.

To change existing tables back to MyISAM do:

ALTER TABLE tbl_name ENGINE=MyISAM;

Also, databases don't have storage engines, tables do. Therefore to see which engine a table is using:

SHOW CREATE TABLE tbl_name; or SHOW TABLE STATUS LIKE 'tbl_name'\G