Page 1 of 1

MySQL 4.1 character set issues in XAMPP 1.4.11?

PostPosted: 31. December 2004 02:02
by kswartz
I've been reading the MySQL documentation at http://dev.mysql.com/doc/mysql/en/Probl ... _sets.html -- all my Perl scripts have been failing with the error mentioned there:

File 'C:\mysql\\share\charsets\?.conf' not found (Errcode: 22)
Character set '#48' is not a compiled character set and is not specified in the 'C:\mysql\\share\charsets\Index' file

I've managed to work around it by doing the following:

1. Copy <xampp_dir>\mysql\share\contents to c:\mysql\share\contents
2. Create file "Index" containing one line: "latin1 48"
3. Copy latin1.xml to latin1.conf

However, I'm wondering if anybody has figured out a better way of fixing this in the XAMPP setup. Various comments on the mysql.com site point to a bug in MySQL, a bug in PHP, and a bug in Apache -- I can't tell how it's any of them. And making the changes to my.cnf (for specifying character-sets-dir) didn't seem to help.

Any suggestions for better workarounds are most welcome.

I'm also putting this here so that: 1) anybody who hits this error can see the workaround, and 2) the XAMPP developers might toss around any ideas for workarounds that could be put into the package itself.

Thanks!

PostPosted: 31. December 2004 02:15
by Wiedmann
File 'C:\mysql\\share\charsets\?.conf' not found (Errcode: 22)
Character set '#48' is not a compiled character set and is not specified in the 'C:\mysql\\share\charsets\Index' file

Can you give us a short code sample to reproduce this error?

PostPosted: 31. December 2004 05:35
by kswartz
Even better -- a one-liner that should work right out of the box:
Code: Select all
perl -e "use DBI; $dbh=DBI->connect('DBI:mysql:database=test;host=localhost','root', '');"

By the way, if what I'm reading on the MySQL site is true, this problem should occur on all platforms, not just Windows. But I haven't been able to verify this.

Thanks!
Keith

PostPosted: 31. December 2004 15:46
by Wiedmann
Hmm,

in a short test with my own Perl compilation, this short script works...

For a real test, i must install the XAMPP perl-addon first. After the holiday... ;-)

BTW:
You can install the Perl from ActiveState into the XAMPP Perl folder.
Then:
| ppm
| install DBI
| install DBD-mysql

(is there a "ppm" in the xampp package?)

Maybe, this will work for you...

PostPosted: 31. December 2004 19:51
by kswartz
Yes, ppm is in the xampp perl-addon (and works). I tried updating DBI and DBD-mysql, and this had no effect. This is because the problem appears to be with MySQL 4.1, not with Perl.

In fact, if you look at several of the MySQL executables, particularly libmysql.dll, you'll see C:/mysql hardcoded in there. But following the suggestion on the MySQL web page mentioned above to tweak it a hex editor didn't do anything, either.

PostPosted: 31. December 2004 19:52
by kswartz
By the way, just to clarify: this is a *brand new* 1.4.11 install. I did not choose to upgrade an older one. It is certainly possible that if you upgraded a 1.4.9 install, this would not happen, but I can't verify that.

This also appears to be unique to Windows installs, unlike what I said previously. (I'm on Windows 2000, but that probably doesn't matter.)

PostPosted: 31. December 2004 21:58
by Wiedmann
By the way, just to clarify: this is a *brand new* 1.4.11 install.

Ok. I have installed my own buiƶd of XAMPP at the moment.

So, Perl and MySQL is my own compilation of the source code. So, i'm sure DBD::mysql is compiled against the new MySQL 4.1.8.

I think, the Perl-AddOn from XAMPP is compiled against the old MySQL Client-Lib...

Character set '#48' is not a compiled character set

Charset #48 is "latin1_general_ci"

This is the default collation in XAMPP. You can try to change this setting in "my.cnf" to:
collation-server = latin1_swedish_ci

PostPosted: 01. January 2005 05:33
by kswartz
Cool! That seems to have done the trick -- no more errors, even without my workaround.

I see now -- when I do a "show collation", it does, indeed, show that latin_general_1 is not compiled. I must have created my database (or the tables) using that character set.

Can we make this change in my.cnf for the next XAMPP release? I.e.: set collation-server in my.cnf to a character set that is likely to always be compiled? (Or is this dependent on the actual database being used, and not the installation?)

Thanks -- this is a much better workaround!