> ## Content Index
> Fetch the complete content index at: https://ostreff.info/llms.txt
> Use this file to discover other available public pages before exploring further.

# MySQL command for finding all MyISAM databases, and convert them to innodb
- URL: https://ostreff.info/mysql-command-for-finding-all-myisam-databases-and-convert-them-to-innodb/
- Published: 2021-01-27T18:44:18.000Z
- Updated: 2021-01-27T18:44:18.000Z
- Author: Jordan Ostreff
- Tags: FreeBSD, MySQL

Today most popular storage engine in latests MySQL databases is InnoDB. But if you have older databases, before the times when InnoDB becomes the king, you must somehow convert your data.

You can easy find which tables are using an older storage engine using:

> SELECT TABLE\_SCHEMA as DbName ,TABLE\_NAME as TableName ,ENGINE as Engine FROM information\_schema.TABLES WHERE ENGINE='MyISAM' AND TABLE\_SCHEMA NOT IN ('mysql', 'information\_schema', 'performance\_schema');

You can generate command sequence which will ALTER needed tables using following:

> SELECT CONCAT('ALTER TABLE ', TABLE\_SCHEMA,'.',TABLE\_NAME, ' ENGINE = InnoDB;') FROM information\_schema.TABLES WHERE ENGINE='MyISAM' AND TABLE\_SCHEMA NOT IN ('mysql', 'information\_schema', 'performance\_schema');

Changing "MyISAM" with needed type to be converted is also possible (from "Aria" e.t.c.).