|
|
Question : PERL DBI MYSQL Import .sql into MySQL using PERL DBI
|
|
I am having trouble importing a .sql file (created from a MySQL export). I was using the following code on a unix box but it doesn't work on a win* box so I am thinking PERL DBI but I wasn't finding any clues.
my $imp=`mysql --user='$db_user' --password='$db_pass' $db_name < $db_file 2>&1 `;
|
Answer : PERL DBI MYSQL Import .sql into MySQL using PERL DBI
|
|
I think the problem is with the redirection of STDERR, the 2>&1 part, it has no meaning is Windows
Try this line: my $imp=system("mysql --user=$db_user --password=$db_pass $db_name < $db_file");
|
|
|
|