php innodb 2 myisam php
<?php// display error is On for us to be notified if there's something wrongini_set ('display_errors','On');error_reporting ( E_ALL );// Config, change this variables$dbServer ="localhost";$dbUser ="帐号";$dbPass ="密码";$dbName = $_GET['dbName'];// Set a connection for our database$link = mysql_connect ( $dbServer, $dbUser, $dbPass ) ordie("unable to connect to msql server: ". mysql_error () );// Select our databasemysql_select_db ( $dbName, $link ) ordie("unable to select database 'db': ". mysql_error () );$result = mysql_query ("show tables");if(! $result) {die('query failed: ');}// Use while loop to convert all tables to MyISAMwhile($row = mysql_fetch_array ( $result )) {// Command Reference: ALTER TABLE tableName ENGINE=MyISAMecho"ALTER TABLE ". $row [0] ." ENGINE=MyISAM; ".'<br/>';mysql_query ("ALTER TABLE ". $row [0] ." ENGINE=MyISAM; ");}?>调用页面<?php// display error is On for us to be notified if there's something wrongini_set ('display_errors','On');error_reporting ( E_ALL );// Config, change this variables$dbServer ="localhost";$dbUser ="帐号";$dbPass ="密码";// Set a connection for our database$link = mysql_connect ( $dbServer, $dbUser, $dbPass ) ordie("unable to connect to msql server: ". mysql_error () );$result = mysql_query ("show databases;");if(! $result) {die('query failed: ');}// Use while loop to convert all tables to MyISAMwhile($row = mysql_fetch_array ( $result )) {echo'<a href="innodb2myisam.php?dbName='.$row[0].'">'.$row[0].'<a/><br/>';}?>
[PHP]代码
<?php // display error is On for us to be notified if there's something wrong ini_set ( 'display_errors', 'On' ); error_reporting ( E_ALL ); // Config, change this variables $dbServer = "localhost"; $dbUser = "帐号"; $dbPass = "密码"; $dbName = $_GET['dbName']; // Set a connection for our database $link = mysql_connect ( $dbServer, $dbUser, $dbPass ) or die ( "unable to connect to msql server: " . mysql_error () ); // Select our database mysql_select_db ( $dbName, $link ) or die ( "unable to select database 'db': " . mysql_error () ); $result = mysql_query ( "show tables" ); if (! $result) { die ( 'query failed: ' ); } // Use while loop to convert all tables to MyISAM while ( $row = mysql_fetch_array ( $result ) ) { // Command Reference: ALTER TABLE tableName ENGINE=MyISAM echo "ALTER TABLE " . $row [0] . " ENGINE=MyISAM; ".'<br/>'; mysql_query ( "ALTER TABLE " . $row [0] . " ENGINE=MyISAM; " ); } ?> 调用页面 <?php // display error is On for us to be notified if there's something wrong ini_set ( 'display_errors', 'On' ); error_reporting ( E_ALL ); // Config, change this variables $dbServer = "localhost"; $dbUser = "帐号"; $dbPass = "密码"; // Set a connection for our database $link = mysql_connect ( $dbServer, $dbUser, $dbPass ) or die ( "unable to connect to msql server: " . mysql_error () ); $result = mysql_query ( "show databases;" ); if (! $result) { die ( 'query failed: ' ); } // Use while loop to convert all tables to MyISAM while ( $row = mysql_fetch_array ( $result ) ) { echo '<a href="innodb2myisam.php?dbName='.$row[0].'">'.$row[0].'<a/><br/>'; } ?>