Mysql-Connect issue with migrating site

This may be a simple issue, but we have some old code and I believe we have not loaded a required module of sorts. The error we get is "Can't locate object method "Connect" via package "mysql" (perhaps you forgot to load "mysql"?)"

It's running from an old CGI routine.

Closed (fixed)


What language is this code in?

Also, is it a module of VIrtualmin, or your own CGI script?

The routine is a shell script and using a call the mysql. So, I'm thinking that there is some module or library that may be missing on this new server. So, I'm trying to call a SQL request from the shell script, but the error indicates that there is a problem with the connector. I saw some information online regarding a missing cgi module. I know it's probably more of an Ubuntu question, but I thought I would pass it by you.

Well, the error you're getting sounds like a Perl error. You may want to make sure you have the Perl database modules installed, including DBI and DBD::mysql.

since the server is being used for some production, I want to make sure I add these modules properly. Do you have some direction? I'm sure I can find it, but I look forward to your info. Thanks.

A simple way to get that module installed would be to use the Ubuntu package... you can install that with this command:

apt-get install libdbd-mysql-perl

Ok. Still haven't found a resolution to this issue. Is there a way to check if this module is installed? I need to see if it is. I don't want to try something and possibly mess something up since we are hosting live sites on this box.

If the libdbd-mysql-perl package is already installed, it won't attempt to install it when you run "apt-get install libdbd-mysql-perl", it will just quit saying that it's already installed.

Also, that package is just a MySQL driver for Perl apps -- since your Perl apps are currently throwing errors that they can't find the MySQL driver -- it sounds like you're already experiencing the worst case... that Perl apps would be unable to access MySQL.

However, you can always run this command to see if that package is installed:

dpkg -l libdbd-mysql-perl