Skip to content

Instantly share code, notes, and snippets.

@SeanPONeil
Created February 3, 2012 18:54
Show Gist options
  • Save SeanPONeil/1731734 to your computer and use it in GitHub Desktop.
Save SeanPONeil/1731734 to your computer and use it in GitHub Desktop.
PHP Script for converting all tables in database to InnoDB engine
<?php
$link = db_connect();
$query = "SHOW tables";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
$tbl = $row[0];
$query = "ALTER TABLE $tbl ENGINE=INNODB";
mysql_query($query);
}
mysql_close($link);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment