I want to transfer data from test server database to live server database. The data is in the form of a .sql file. So using php on stage server can I transfer the data using shell_exec();
$command = "mysql -u{$vals['db_user']} -p{$vals['db_pass']} "
. "-h {$vals['db_host']} -D {$vals['db_name']} < {$script_path}";
$output = shell_exec($command . '/shellexec.sql');
The above code is not working. is there any other way?