iODBC and MySQL
Hello - has anybody had any success with ODBC.pm (perl 5.6.1)?
I'm using
Linux version 2.4.19 (root@xxxx.au) (gcc version 2.95.4 20011002 (Debian
prerelease))
mysql Ver 11.16 Distrib 3.23.49, for pc-linux-gnu (i686)
MyODBC (installed before iODBC)
Oops, I was in a hurry and used dselect to install MyODBC that installed
a bunch of stuff without iODBC
Then I installed iODBC and copied DBD::ODBC from cpan. Alas, it wouldn't
build so I went to the Makfile.PL
under .cpan/build and edited the part for iODBC manager that asked for
ilib..something/lib and removed /lib
(iodbc installed to /usr/lib). That made the ODBC.pm and then a make
install put it at ...5.6.1...DBD/ODBC.pm.
Now, when I run a sample
#!/usr/bin/perl
my $dsn = 'test';
my $dbd = 'DBI:ODBC';
use DBI;
$dbh = DBI->connect("$dbd:$dsn", "xxxx", "xxxx", { RaiseError => 1 });
exit();
.. This is the output...
DBI->connect(test) failed: [iODBC][Driver Manager]Data source name not
found and no default driver specified. Driver could not be loaded
(SQL-IM002)(DBD: db_login/SQLConnect err=-1) at ./test_odbc.pl line 9
( I've filled in the odbc.ini )
Trace = On
TraceFile= stderr
Driver = /usr/local/lib/libmyodbc.so
DSN = test
SERVER = x.x.x.x
USER =
PASSWORD = xxxx
PORT = 3306
#OPTIONS = 1
#DATABASE= test
#SOCKET = /tmp/mysql.sock
Any help would be greatly appreciated.
Thanks,
Scott.
Reply to: