I get a 500 Internal Server Error in my web browser immediately after I view a php page that runs the following script:
exec("mysql -h db.server.com -u myuser -pmypass db < db.sql");
The mysql command takes a long time to execute because db.sql is a very big file and it takes time to send it to an external database server. While the command executes, all other php pages on my shared hosting services yields a 500 Internal Server error.
Is there a way to get rid of the 500 internal server error and have my other php pages running? Is there a better way to import my sql file?