I have an issue with the MySQL SOURCE command. I am getting the following error:
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SOURCE /var/www/apps/modx_install.sql' at line 1
The query I am executing is as follows:
mysql_query('SOURCE /var/www/apps/modx_install.sql;')
I was wondering what I was doing wrong here as I have read from several sources that this is the correct syntax.
Thanks
it seems your MySQL-Server doesn't know the source command.
If you have shell access you could use
mysql --user=$user --password=$password $database < $file
You can try the same from within PHP
shell( "mysql --user=$user --password=$password $database < $file" );
Cheers.
haggi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With