Skip to content

Instantly share code, notes, and snippets.

@albanpeignier
Created November 30, 2014 08:29
Show Gist options
  • Save albanpeignier/bce36be7904720cd5cba to your computer and use it in GitHub Desktop.
Save albanpeignier/bce36be7904720cd5cba to your computer and use it in GitHub Desktop.
Fixes mysql engine for Rivendell tables
SET @DATABASE_NAME = 'Rivendell';
SELECT CONCAT('ALTER TABLE ', table_name, ' ENGINE=MyISAM;') AS sql_statements
FROM information_schema.tables AS tb
WHERE table_schema = @DATABASE_NAME
AND `ENGINE` = 'InnoDB'
AND `TABLE_TYPE` = 'BASE TABLE'
ORDER BY table_name DESC;
@albanpeignier
Copy link
Author

To test it :

$ mysql -N -u rduser -pletmein Rivendell < innodb-for-rivendell.sql
ALTER TABLE ...

To change tables :

$ mysql -N -u rduser -pletmein Rivendell < innodb-for-rivendell.sql | mysql -u rduser -pletmein Rivendell

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