Created
          August 9, 2012 07:21 
        
      - 
      
- 
        Save ckng/3301956 to your computer and use it in GitHub Desktop. 
    Convert MYISAM 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
    
  
  
    
  | # Originally from http://highervisibilitywebsites.com/convert-your-mysql-database-myisam-innodb-and-get-ready-drupal-7-same-time | |
| mysql -u [USER_NAME] -p -e "SHOW TABLES IN [DATABASE_NAME];" | tail -n +2 | xargs -I '{}' echo "ALTER TABLE {} ENGINE=INNODB;" > alter_table.sql | |
| perl -p -i -e 's/(search_[a-z_]+ ENGINE=)INNODB/\1MYISAM/g' alter_table.sql | |
| mysql -u [USER_NAME] -p [DATABASE_NAME] < alter_table.sql | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment