I am trying to connect perl and mysql in a program but receive error: perl: symbol lookup error: /usr/local/lib/perl/5.10.1/auto/DBD/mysql/mysql.so: undefined symbol: mysql_init. Please guide..
I have installed mysql through xampp and run it using xampp (/opt... commands) on terminal. Mysql is running successfully from terminal, but i cannot retreive values through perl program.
Perl program i am running is:
#!/usr/bin/perl -w
use DBI;
$dbh = DBI->connect('dbi:mysql:first','root','shaifu')
or die "Connection Error: $DBI::errstr\n";
$sql = "select * from q";
$sth = $dbh->prepare($sql);
$sth->execute
or die "SQL Error: $DBI::errstr\n";
while (@row = $sth->fetchrow_array) {
print "@row\n";
}
where first is database and q is table.
Also DBI and DBD are installed as perl -e 'use DBI' and perl -e 'use DBD::mysql;' return nothing on terminal.
Please help me to solve the problem.
ldd /usr/local/lib/perl/5.10.1/auto/DBD/mysql/mysql.soand post the result in your question?auto/DBD/mysql/mysql.sodepends much more libraries than what you listed.