I have a dump file (backup.sql).
How can I import it in my local database with a php script?
I tried this:
require("../required/config.php");
$connect = mysql_connect($server,$user,$pass);
$select_db = mysql_select_db($db, $connect);
$del_db = mysql_query("DROP DATABASE test", $connect);
$dreate_db = mysql_query("CREATE DATABASE test", $connect);
$upload_backup = exec("C:/mysql/bin/mysql -e backup.sql test");
And also tried ending:
$upload_backup = exec("C:/mysql/bin/mysql test < backup.sql");
It doesn't work: naturally backup.sql is in the mysql/bin directory... and I tried also with the entire path: "C:/mysql/bin/backup.sql"