Trouble with MySQL, DBI/DBD::mysql
Folks, I am trying to setup a replica of an environment currently running at the Cook Islands National Library in order to diagnose two problems. It is a Koha 2.2.6 install with MySQL 5.0 (I have made all of the documented sql changes plus a couple of undocumented ones to support mysql 5 thanks to "Katipo Chris") on Debian Sarge. All modules and system components are installed, the /usr/local/koha directory tree has been restored from the Cook Islands' backup as has the MySQL database. Everything looks good, except that a browser call to opac_main.pl yields the following error in the apache log: DBI connect('CKI:localhost','kohaadmin',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/local/koha/intranet/modules/C4/Context.pm line 411 Can't call method "prepare" on an undefined value at opac-main.pl line 17. Running a quick "mysqladmin version" revealed that mysql socket location is actually /tmp/mysql.sock . However, /etc/mysql/my.cnf has both the client and server socket set to /var/run/mysqld/mysqld.sock . So I changed all mentions of /var/run/mysqld/mysqld.sock in my.cnf to /tmp/mysql.sock (and even set and exported the MYSQL_UNIX_PORT env variable for good measure) and restarted mysqld_safe, then requested opac-main.pl again and received the same error above. In summary, I cannot make mysqld_safe listen at anything other than /tmp/mysql.sock and I cannot make perl DBI/DBD::mysql attempt to connect anywhere other than /var/run/mysqld/mysqld.sock . Any ideas? -cht Chris Hammond-Thrasher MLIS Library Systems Manager University of the South Pacific Suva, Fiji +679 3232233 hammondthrasher_c@usp.ac.fj
In summary, I cannot make mysqld_safe listen at anything other than /tmp/mysql.sock and I cannot make perl DBI/DBD::mysql attempt to connect anywhere other than /var/run/mysqld/mysqld.sock .
Any ideas?
Hi Chris In your /etc/my.cnf is skip-networking set on, if you turn this off you could get mysql listening on the network, and then connect to it with a tcp socket, rather than a unix one. Chris
Chris (and list), I can connect via a TCP/IP port from the command line. For example, "mysqladmin -h penguin version" yields: <snip/> Server version 5.0.33-log Protocol version 10 Connection penguin via TCP/IP TCP port 3306 Uptime: 41 sec Threads: 1 Questions: 2 Slow queries: 0 Opens: 12 Flush tables: 1 Open tables: 6 Queries per second avg: 0.049 So, I changed my koha.conf to point to "penguin" rather than "localhost" and tried to hit opac-main.pl again and I found a new error in my apache error log: DBI connect('CKI:penguin','kohaadmin',...) failed: Client does not support authentication protocol requested by server; consider upgrading MySQL client at /usr/local/koha/intranet/modules/C4/Context.pm line 411 Can't call method "prepare" on an undefined value at opac-main.pl line 17. What on earth does that mean? If I try, "mysql -h penguin -u kohaadmin -p CKI" from the command line and provide the password in the koha.conf file, I get a very nice connection to the CKI db. -cht Chris Hammond-Thrasher MLIS Library Systems Manager University of the South Pacific Suva, Fiji +679 3232233 hammondthrasher_c@usp.ac.fj -----Original Message----- From: Chris Cormack [mailto:chris@katipo.co.nz] Sent: Wednesday, 7 February 2007 2:01 PM To: Chris Hammond-Thrasher Cc: koha@lists.katipo.co.nz Subject: Re: [Koha] Trouble with MySQL, DBI/DBD::mysql
In summary, I cannot make mysqld_safe listen at anything other than
/tmp/mysql.sock and I cannot make perl DBI/DBD::mysql attempt to connect
anywhere other than /var/run/mysqld/mysqld.sock .
Any ideas?
Hi Chris In your /etc/my.cnf is skip-networking set on, if you turn this off you could get mysql listening on the network, and then connect to it with a tcp socket, rather than a unix one. Chris
Chris Hammond-Thrasher a écrit :
So, I changed my koha.conf to point to "penguin" rather than "localhost" and tried to hit opac-main.pl again and I found a new error in my apache error log:
DBI connect('CKI:penguin','kohaadmin',...) failed: Client does not support authentication protocol requested by server; consider upgrading MySQL client at /usr/local/koha/intranet/modules/C4/Context.pm line 411
Can't call method "prepare" on an undefined value at opac-main.pl line 17.
What on earth does that mean? If I try, "mysql -h penguin -u kohaadmin -p CKI" from the command line and provide the password in the koha.conf file, I get a very nice connection to the CKI db.
From /usr/share/doc/mysql-server-5.0/README.Debian.gz in the Debian package:
* SOME APPLICATION CAN NO LONGER CONNECT: ========================================= This application is probably linked against libmysqlclient12 or below and somebody has created a mysql user with new-style passwords. The old_passwords=1 option in /etc/mysql/my.cnf might help. If not the application that inserted the user has to be changed or the application that tries to connect updated to libmysqlclient14 or -15. Read http://dev.mysql.com/doc/refman/5.0/en/old-client.html IMHO, you probably has to upgrade php[45]-mysql. When using apt-cache to look at php4-mysql, I can see that sarge version is still linked with libmysqlclient12 whereas etch/sid is linked with new libmysqlclient15off : vdanjean@cayuga:~$ LC_ALL=C apt-cache policy php4-mysql php4-mysql: Installed: 6:4.4.4-8 Candidate: 6:4.4.4-8 Version table: *** 6:4.4.4-8 0 990 http://ftp.fr.debian.org unstable/main Packages 500 http://ftp.fr.debian.org testing/main Packages 100 /var/lib/dpkg/status 4:4.3.10-16 0 500 http://ftp.fr.debian.org stable/main Packages vdanjean@cayuga:~$ apt-cache show php4-mysql Package: php4-mysql [...] Version: 6:4.4.4-8 Depends: libc6 (>= 2.3.6-6), libmysqlclient15off (>= 5.0.24-2), phpapi-200506 [...] Package: php4-mysql [...] Version: 4:4.3.10-16 Replaces: php4-cgi-mysql Depends: libc6 (>= 2.3.2.ds1-21), libmysqlclient12, debconf (>= 0.5) | debcon [...] Best regards, Vincent
-cht
Vincent Danjean wrote:
IMHO, you probably has to upgrade php[45]-mysql. When using apt-cache to look at php4-mysql, I can see that sarge version is still linked with libmysqlclient12 whereas etch/sid is linked with new libmysqlclient15off :
Vincent is on the right track it is the passwords. But upgrading PHP wont help, as Koha is written in perl. What I think needs to be done is to set the password using the OLD_PASSWORD method This is talked about here http://lists.katipo.co.nz/public/koha/2006/009893.html Either that, or try upgrading the DBD::MySQL perl module, perhaps try that first. Chris -- Chris Cormack Katipo Communications Programmer www.katipo.co.nz 027 4500 789
Chris Cormack a écrit :
Vincent Danjean wrote:
IMHO, you probably has to upgrade php[45]-mysql. When using apt-cache to look at php4-mysql, I can see that sarge version is still linked with libmysqlclient12 whereas etch/sid is linked with new libmysqlclient15off :
Vincent is on the right track it is the passwords. But upgrading PHP wont help, as Koha is written in perl.
Oups, I would say it's too early ;-)
Either that, or try upgrading the DBD::MySQL perl module, perhaps try that first.
Yes, there is the same situation as php for DBD::MySQL perl module: vdanjean@cayuga:~$ LC_ALL=C apt-cache policy libdbd-mysql-perl libdbd-mysql-perl: Installed: 3.0008-1 Candidate: 3.0008-1 Version table: *** 3.0008-1 0 990 http://ftp.fr.debian.org unstable/main Packages 500 http://ftp.fr.debian.org testing/main Packages 100 /var/lib/dpkg/status 2.9006-1 0 500 http://ftp.fr.debian.org stable/main Packages vdanjean@cayuga:~$ apt-cache show libdbd-mysql-perl Package: libdbd-mysql-perl [...] Version: 3.0008-1 Depends: libc6 (>= 2.3.6-6), libmysqlclient15off (>= 5.0.24-2), perl (>= 5.8.8 [...] Package: libdbd-mysql-perl [...] Version: 2.9006-1 Depends: libc6 (>= 2.3.2.ds1-4), libmysqlclient12, zlib1g (>= 1:1.2.1), perl Best regards, Vincent
Vincent, Chris, and list, I updated DBD::mysql (there was a new version released yesterday) and I can now view the main opac page and the main intranet page. However, all queries fail due to a timezone related error with Date::Manip::Date_TimeZone . If I cannot get to the bottom of it, I will post here. Thank you, guys. -cht Chris Hammond-Thrasher MLIS Library Systems Manager University of the South Pacific Suva, Fiji +679 3232233 hammondthrasher_c@usp.ac.fj -----Original Message----- From: Vincent Danjean [mailto:vdanjean.ml@free.fr] Sent: Wednesday, 7 February 2007 7:26 PM To: hammondthrasher_c@usp.ac.fj Cc: Koha@lists.katipo.co.nz Subject: Re: [Koha] Trouble with MySQL, DBI/DBD::mysql Chris Cormack a écrit :
Vincent Danjean wrote:
IMHO, you probably has to upgrade php[45]-mysql. When using apt-cache to look at php4-mysql, I can see that sarge version is still linked with libmysqlclient12 whereas etch/sid is linked with new libmysqlclient15off :
Vincent is on the right track it is the passwords. But upgrading PHP wont help, as Koha is written in perl.
Oups, I would say it's too early ;-)
Either that, or try upgrading the DBD::MySQL perl module, perhaps try that first.
Yes, there is the same situation as php for DBD::MySQL perl module: vdanjean@cayuga:~$ LC_ALL=C apt-cache policy libdbd-mysql-perl libdbd-mysql-perl: Installed: 3.0008-1 Candidate: 3.0008-1 Version table: *** 3.0008-1 0 990 http://ftp.fr.debian.org unstable/main Packages 500 http://ftp.fr.debian.org testing/main Packages 100 /var/lib/dpkg/status 2.9006-1 0 500 http://ftp.fr.debian.org stable/main Packages vdanjean@cayuga:~$ apt-cache show libdbd-mysql-perl Package: libdbd-mysql-perl [...] Version: 3.0008-1 Depends: libc6 (>= 2.3.6-6), libmysqlclient15off (>= 5.0.24-2), perl (>= 5.8.8 [...] Package: libdbd-mysql-perl [...] Version: 2.9006-1 Depends: libc6 (>= 2.3.2.ds1-4), libmysqlclient12, zlib1g (>= 1:1.2.1), perl Best regards, Vincent
On 07/02/07, Chris Hammond-Thrasher <hammondthrasher_c@usp.ac.fj> wrote:
It is a Koha 2.2.6 install with MySQL 5.0 (I have made all of the documented sql changes plus a couple of undocumented ones to support mysql 5 thanks to "Katipo Chris") on Debian Sarge.
Can you share the sql changes you made to get Koha running with mysql 5. I am still stuck with my installation on Fedora Core 6. Maybe the fixes you used could get me up and running. Regards, Krsnendu dasa
participants (4)
-
Chris Cormack -
Chris Hammond-Thrasher -
Krsnendu dasa -
Vincent Danjean