Created
October 14, 2016 20:59
-
-
Save toby78/53678d951b43b6046a09f55875f48aa7 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
require_once("config.php"); | |
mysql_connect($dbhost, $dbuname, $dbpass); | |
@mysql_select_db($dbname) or die ("???"); | |
$result=mysql_query("SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES | |
WHERE engine = 'MyISAM' and table_schema not in ('mysql','information_schema')"); | |
while (list($database,$table) = mysql_fetch_array($result)) | |
{ | |
echo $database; echo "-".$table; echo "\n"; | |
echo "pt-online-schema-change --alter \"ENGINE=InnoDB\" D=".$database.",t=".$table."\n"; | |
echo exec("pt-online-schema-change --alter \"ENGINE=InnoDB\" D=".$database.",t=".$table." -u".$dbuname." -p".$dbpass." --alter-foreign-keys-method=auto --execute"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment