Last active
March 12, 2025 03:09
-
-
Save xyzulu/1cfcc05c57167e07f829bd20206e1f8c to your computer and use it in GitHub Desktop.
Find all MyISAM database tables and output the .sql needed to convert them to InnoDB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You will need to login to mysql/mariadb (possibly as root user, or a user with access to all databases) first, usually: mysql | |
SELECT CONCAT('ALTER TABLE ',TABLE_SCHEMA,'.', table_name, ' ENGINE=InnoDB;') AS sql_statements | |
FROM information_schema.tables | |
WHERE TABLE_SCHEMA NOT IN ('mysql', 'information_schema', 'performance_schema', 'innodb', 'sys', 'tmp') | |
AND ENGINE = 'MyISAM' | |
AND TABLE_TYPE = 'BASE TABLE' | |
ORDER BY TABLE_SCHEMA, table_name DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment