source is a command understood only by the mysql client program. It's not a
SQL statement.
On 8/10/05 9:13, "Ian Roth" <[EMAIL PROTECTED]> wrote:
> I have been trying to execute a Mysql source command to import a database
> backup. Perl DBI outputs the following error when a script containning the
> source command is used:
>
> DBD::mysql::st execute failed: 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 /tmp/file' at line 1 at /etc/scripts/db.pl line 23.
>
> I have tried to perform both a do() and execute() as in the following lines:
>
> $db->do("source /tmp/file");
>
> and
>
> $source = $db->prepare("source /tmp/file");
> $source->execute();
>
> Perl DBI used is the current release and the operating system is Slackware 9.1
> with Perl 5 and Mysql 4.1.12. I am able execute the same "source /tmp/file"
> command on the mysql command line with success, thus this has been quite
> difficult bug to work out.
>
> Ian
> iroth at closednetworks dot com
>