Import And Export Mysql Heavy Database

Exporting and Importing database through PhpMyadmin is only good if you have small database. But you want to import and export big database then it is not possible. Here I show you script which is easily import and export heavy mysql database. Import big mysql database [php] <?php $mysqlDatabaseName ='MyDBName'; $mysqlUserName ='username'; $mysqlPassword ='yourPassword'; $mysqlHostName ='localhost'; $mysqlImportFilename ='db.sql'; $command='mysql -h' .$mysqlHostName .' -u' .$mysqlUserName .' -p' .$mysqlPassword .' ' .$mysqlDatabaseName .' < ' .$mysqlImportFilename; exec($command,$output=array(),$worked); switch($worked){ case 0: echo 'Import file <b>' .$mysqlImportFilename .'</b> successfully imported to database <b>' .$mysqlDatabaseName .'</b>'; break; case 1: echo 'Error during import. Please make sure the import file is saved in the same folder as this script and check your mysql details like username, password, host and database name.'; break; } ?> [/php] Export…
Read More