Change all database table engines to InnoDB
I want to use sql query to change all my database tables from MyISAM to InnoDB.
I used the query below. While this gives me a successful message, it doesn't work. However, my s Storage Engine table is MyISAM.
SELECT CONCAT('ALTER TABLE ', table_name, ' ENGINE=InnoDB;') as ExecuteTheseSQLCommands
FROM information_schema.tables WHERE table_schema = 'name_of_the_database'
ORDER BY table_name DESC;
+3
source to share
2 answers
See http://dev.mysql.com/doc/refman/5.0/en/converting-tables-to-innodb.html
ALTER TABLE t1 ENGINE=InnoDB;
edit : oh wait, did you create statements like this, but they didn't work?
0
source to share
-
If you have knowledge in PHP then this script will help you:
-
If you have knowledge in Shell script this link will help you:
http://shrubbery.homeip.net/c/display/W/Shell+and+MySQL#ShellandMySQL-ConvertMyISAMtablestoInnoDB (domain name changed by wiki owner)
+1
source to share