RE: I updated DBD and broke some scripts
Yair Lapin <[email protected]> Mon, 3 Mar 2008 11:09:43 +0200
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Message-ID | <A226E8A17225FF47928E24603A17A287488FE34853@mango.hustaff.huji.local> |
Hi, I had problems like this with old scripts, the interface Mysql doesn't exist yet in the new perl version. You must use DBI::mysql , also you must change part of the code, the new interface is different, connect and query calls are different. You can try to install the old Mysql-Msql interface but is not recommended. -----Original Message----- From: J. [mailto:[email protected]] Sent: Monday, March 03, 2008 10:49 AM To: [email protected] Subject: I updated DBD and broke some scripts Hi everyone, I've been using a group of perl scripts since 1997 or so to maintain a small database. Recently I ran a system update and DBD, DBI and Perl got updated to newer versions (DBD to 4.00.5 and DBI to 1.601) and now I'm having trouble running my scripts. It seems that the "USE Mysql;" is no longer valid and the new "USE mysql;" doesn't have the same interface that the scripts use. The way the scripts work is that a db object is created once when the script runs and queries are sent using the syntax: $results = $databaseObject->query( "SELECT something from some_tables ); at first I was getting this error: Can't locate mysql.pm in @INC (@INC contains: /etc/perl /usr/lib/perl5/vendor_perl/5.8.8/i686-linux /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/site_perl/5.8.8/i686-linux /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/5.8.8/i686-linux /usr/lib/perl5/5.8.8 /usr/local/lib/site_perl .) at LIBR.pm line 8. BEGIN failed--compilation aborted at LIBR.pm line 8. Compilation failed in require at ./update.pl line 3. BEGIN failed--compilation aborted at ./update.pl line 3. ... then I changed the USE line to "use DBD::mysql;" and now I'm getting this error: Can't locate object method "connect" via package "mysql" (perhaps you forgot to load "mysql"?) at LIBR.pm line 84. Someone on my distribution's forum pointed this out from CPAN: "As of March 1998, the Msql and Mysql modules are obsoleted by the DBI drivers DBD::mSQL and DBD::mysql, respectively. You are strongly encouraged to implement new code with the DBI drivers. In fact, Msql and Mysql are currently implemented as emulations on top of the DBI drivers." and suggested that possibly the emulation has finally been removed. Can anyone shed a little more light or offer some suggestion on a way I can keep using my scripts running without rewriting them all to use different functions/interfaces? Thanks. -Jason ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- MySQL Perl Mailing List For list archives: http://lists.mysql.com/perl To unsubscribe: http://lists.mysql.com/[email protected] -- MySQL Perl Mailing List For list archives: http://lists.mysql.com/perl To unsubscribe: http://lists.mysql.com/[email protected]