Skip to content

Instantly share code, notes, and snippets.

@sergeliatko
Created November 22, 2017 16:56
Show Gist options
  • Select an option

  • Save sergeliatko/beec8e2514dc34549e0ece991037cef2 to your computer and use it in GitHub Desktop.

Select an option

Save sergeliatko/beec8e2514dc34549e0ece991037cef2 to your computer and use it in GitHub Desktop.
Generates SQL to alter all tables from a database (DBName) to InnoDB engine.
SELECT CONCAT( "ALTER TABLE ", table_name, " ENGINE=InnoDB;" )
FROM information_schema.tables
WHERE engine = 'MyISAM'
AND table_schema = 'DBName';
@sergeliatko
Copy link
Copy Markdown
Author

Just replace DBName with the name of your database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment