For importing mysql database from mysql schema file
$command='mysql -u ' .$username .' -p' .$password .' -h ' .$hostname .' ' .$database .' < ' .$filename;
exec($command,$output=array(),$worked);
if($worked==1){
echo "database import failed";
exit;
}