Create Query for all table in mysql


1. create query for change all tables to innodb ENGINE in mysql


SELECT CONCAT('ALTER TABLE ', table_name, ' ENGINE=InnoDB;') as ExecuteTheseSQLCommands
FROM information_schema.tables WHERE table_schema = 'database_name'
ORDER BY table_name DESC;

2. create query for  TRUNCATE TABLE  all database table


SELECT CONCAT('TRUNCATE TABLE ', table_name, ';')
FROM INFORMATION_SCHEMA.tables
WHERE table_schema = 'database_name'

Comments

  1. Hey!
    Thanks for your great post, there are much nice information that I am sure a huge number of guys and gals don’t know.


    Vachel
    PHP Developer Chicago
    cmscentral.net

    ReplyDelete

Post a Comment

If you Satisfied , Please Leave a comment

Popular posts from this blog

Call PHP Function In JavaScript Using Ajax

List of Post Category Wise in wordpress