This works from the command line (with "mypassword", "mydatabase", and "myfile" replaced by the real things, of course):
Code: Select all
mysql --password=mypassword mydatabase < myfileCode: Select all
if (system("mysql --password=$Password $Database < $File")) {...I suppose I could open the file, parse it, then send it to MySQL as a query, but it seems that this simple, common action should be accomplished much more quickly.
Is it just me or is mysql_restore() an obvious choice for a future standard PHP function? I have thought of a few others as well. Hmm... I might look into writing some myself then contributing them, but not until after I figure this out. Heh.