DBD::mysql connect dying with "Can"t initialize character set latin1"
am 28.06.2007 04:31:38 von jeff_nokesI just posted this on the perl@mysql mailing list, but there is so little traffic there apparently, I thought I'd post this here too. I hope it is contextually OK.
------------------------------------------------------------ -----------------------
Hi,
I have a project where I have multiple mod_perl hosts that need
to connect to a MySQL 5.0.37 instance. The mod_perl app runs on RedHat
7.2, and the MySQL server runs on Solaris 10.
I chose to use a
pre-compiled linux binary package from MySQL, that comes with all
related libraries, header files, etc. I successfully built my
DBD::mysql using the pre-compiled package libraries, but am having
difficulties connecting to the server. I'm seeing the following error
when I try to connect:
Character set 'latin1' is not a
compiled character set and is not specified in the
'/usr/local/mysql/share/mysql/charsets/Index.xml' file
DBI connect('database=blah blah) failed: Can't initialize character set latin1 (path: /usr/local/mysql/share/mysql/charsets/)
I'm
assuming this path is something that is dictated via the pre-built
package I'm using. I have this package on a single development host to
do the linking of DBD::mysql where that path does exist, but not on my
other dev/QA or prod hosts.
I dug around a bit on Google and in the DBI, DBD::mysql and MySQL docs, and came across this:
http://dev.mysql.com/doc/refman/5.0/en/cannot-initialize-cha racter-set.html
I'm
wondering if there is a way that I can tell the DBD::mysql client
library an arbitrary path to those charset files, or if there is a way
to inlcude an arbitrary path or the charset files themselves as part of
the process that generates .so? Am I even barking up the right tree?
I
also have some design constraints in that I cannot install this version
of MySQL on my mod_perl hosts. Operational policy dictates that all
code, libraries, configurations, etc. that I need, must be deployed in
the build as a self-contained entity. I should also mention that the
schema I'm connecting to is all in UTF8.
If anyone has any suggestions, I'd love to hear them. And thanks in advance for any assistance you can offer.