E
ewitkop90
This is my code:
__________________________________________________________________
#!/usr/bin/perl -w
#insert data into mysql
use DBI;
$dbh = DBI->connect('DBI:mysql;firewall:localhost:3306','xxxx',
'xxxxxxx',
{RaiseError => 1, AutoCommit => 1 })
$dbh->do("LOAD DATA INFILE '/var/log/firewall/ns-complete' INTO TABLE
firewall FIELDS TERMINATED BY '
,' LINES TERMINATED BY '\n'");
$dbh->disconnect;
#EOF
_________________________________________________________________
But it is not working. It is giving me the following error:
Scalar found where operator expected at ./mysql-fwlog-input line 9,
near ")
$dbh"
(Missing semicolon on previous line?)
syntax error at ./mysql-fwlog-input line 9, near ")
$dbh"
Execution of ./mysql-fwlog-input aborted due to compilation errors.
Can someone point out what is wrong. According to my docs, this is the
right syntax.
__________________________________________________________________
#!/usr/bin/perl -w
#insert data into mysql
use DBI;
$dbh = DBI->connect('DBI:mysql;firewall:localhost:3306','xxxx',
'xxxxxxx',
{RaiseError => 1, AutoCommit => 1 })
$dbh->do("LOAD DATA INFILE '/var/log/firewall/ns-complete' INTO TABLE
firewall FIELDS TERMINATED BY '
,' LINES TERMINATED BY '\n'");
$dbh->disconnect;
#EOF
_________________________________________________________________
But it is not working. It is giving me the following error:
Scalar found where operator expected at ./mysql-fwlog-input line 9,
near ")
$dbh"
(Missing semicolon on previous line?)
syntax error at ./mysql-fwlog-input line 9, near ")
$dbh"
Execution of ./mysql-fwlog-input aborted due to compilation errors.
Can someone point out what is wrong. According to my docs, this is the
right syntax.