9 1 4

Prestashop Blogs

CONVERTING INNODB TO MYISAM

Your server not support InnoDb, and you can use syntax ALTER TABLE table_name ENGINE=MyIsam in SQL - PHPMyAdmin

or you can use the PHP script, this script I got after search in google :

<?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 = "root";
$dbPass = "";
$dbName = "MyIsam"; Database name

// 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
mysql_query("ALTER TABLE ".$row[0]." ENGINE=MyISAM; ");
}

?>

how to use it, just copy code above in notepad & name it convert.php than upload in your root,
or if u use xamp/wamp server/localhost  put in under www root






0 comments:

 

Blogger news

Blogroll

About