Bug 153588 - databases/mysql55-server: Character set 'latin1' is not a compiled character set and is not specified
Summary: databases/mysql55-server: Character set 'latin1' is not a compiled character ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alex Dupre
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-31 19:50 UTC by rsecor
Modified: 2011-01-09 12:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rsecor 2010-12-31 19:50:08 UTC
Please reference the following MySQL bug report: http://bugs.mysql.com/bug.php?id=59243

Under perl:
Failure on connection and exits script.

Under php:
Failure on connection and script just hangs.

This issue seems to be the same as those having problems with ODBC connectors, etc that
I've seen in other bugs. However, they do not go on to specifically find the issue and
ultimately correct it.

It also appears that this bug has found it's way into the code on and off for years. It
must be something simple somewhere that anyone coding anything in MySQL must be made
aware of, once found, so that it does not show up again, after it's fixed, in the future.

Fix: 

Perl uses the libraries for the currently installed copy of MySQL.
PHP uses the libraries for the currently installed copy of MySQL where
WITH_MYSQLDN=false.

This leads me to believe it is something in MySQL itself.

Temporary fix for PHP is to compile the PHP library with WITH_MYSQLDN=true so that it
uses the PHP embedded libraries for talking with MySQL. While this is not desired it does
work.

-----------------------------------------------------------------
Downloaded:
mysql-5.5.8-freebsd8.0-x86_64.tar.gz

Extracted to:
/usr/local/mysql-5.5.8-freebsd8.0-x86_64
Linked to /usr/local/mysql

And re-compiled/re-installed p5-DBD-mysql against it by doing the following:
export PATH=/usr/local/mysql:$PATH
cd /usr/ports/databases/p5-DBD-mysql
make clean
make deinstall
make install

This fixes the perl module. I would guess that the same would be true of the php
modules.
How-To-Repeat: On FreeBSD 8.1-RELEASE install the following ports:

For Perl:
lang/perl5.12
databases/mysql55-client
databases/mysql55-server
www/apache22
databases/p5-DBI
databases/p5-DBD-mysql55

For php:
lang/perl5.12
databases/mysql55-client
databases/mysql55-server
lang/php5
databases/php5-mysql
 WITH_MYSQLND=false
databases/php5-mysqli
 WITH_MYSQLND=false
Comment 1 Mark Linimon 2011-01-03 19:10:06 UTC
Exactly which ports(s) should be modified?  It is not clear to me from
the message.
Comment 2 rsecor 2011-01-03 19:14:08 UTC
Mark,


Based on the information received from the MySQL bug report: =
http://bugs.mysql.com/bug.php?id=3D59243

My guess would be it's something to do with either a patch in the =
FreeBSD Port system or a configuration option.

It seemed fine in MySQL 5.1 but 5.5 is exhibiting the problem.


Thanks,
Richard A Secor
rsecor@seqlogic.com


On Jan 3, 2011, at 14:10 , Mark Linimon wrote:

> Exactly which ports(s) should be modified?  It is not clear to me from
> the message.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2011-01-03 20:42:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

apparently affects databases/mysql55-server.
Comment 4 Vincent Bachelier 2011-01-06 09:09:57 UTC
I have found this link
http://dev.mysql.com/doc/refman/5.5/en/cannot-initialize-character-set.html

May be they is something to add to mysql55-server

MYSQLND is another way to fix but it's not the best way, because we
have to add this to all package.

Here some package which not support it :

php5-pdo_mysql (crash on compilation)
postfix-mysql (don't support this option)

It's boring, and everything around mysql55 (5.5.8) doesn't work well anymore !
Comment 5 rsecor 2011-01-06 16:44:25 UTC
Thanks to Vincent's response I have some found some differences in the =
documentation between mysql51 and mysql55:


5.1:  =
http://dev.mysql.com/doc/refman/5.1/en/cannot-initialize-character-set.htm=
l
	=95 The character set is a multi-byte character set and you have =
no support for the character set in the client. In this case, you need =
to recompile the client by running configure with the =
--with-charset=3Dcharset_name or --with-extra-charsets=3Dcharset_name =
option. See Section 2.11.4, =93MySQL Source-Configuration Options=94.

All standard MySQL binaries are compiled with =
--with-extra-charsets=3Dcomplex, which enables support for all =
multi-byte character sets. See Section 2.11.4, =93MySQL =
Source-Configuration Options=94.


5.5:  =
http://dev.mysql.com/doc/refman/5.5/en/cannot-initialize-character-set.htm=
l
	=95 The character set is a multi-byte character set and you have =
no support for the character set in the client. In this case, you need =
to recompile the client by running CMake with the =
-DDEFAULT_CHARSET=3Dcharset_name or -DWITH_EXTRA_CHARSETS=3Dcharset_name =
option. SeeSection 2.11.4, =93MySQL Source-Configuration Options=94.

All standard MySQL binaries are compiled with =
-DWITH_EXTRA_CHARSETS=3Dcomplex, which enables support for all =
multi-byte character sets. See Section 2.11.4, =93MySQL =
Source-Configuration Options=94.


Where 5.1 mentions configure 5.5 is saying CMake. Not sure but this =
could mean the command-line switches for configure/CMake have changed.


Thanks,
Richard A Secor
rsecor@seqlogic.com
Comment 6 daniel.mueller 2011-01-07 10:39:48 UTC
I have similar problems here.

Since an upgrade to the 5.5.8 port, DBD::mysql can't connect anymore and throws the
charset error.

I have tried a little C program, which calls mysql_real_connect(), and can reproduce
the error.
If I link the binary against -lthr, the problem is gone, and the connect succeeds.

IMHO this is clearly a bug in libmysql_client.so.16 installed by the port:
The test program doesn't use threads, so there should be no reason to link against the
thread library.

The bug affects all applications which doesn't link the thread library.
In the case of perl and php 5.3.4 it should be possible to get them working by selecting
the thread options of the ports. (I haven't tried that yet.)

My test program can be downloaded at:
http://merkur.inexio.net/patches/mytest.tgz

How to test:
-The parameters for mysql_real_connect() must possibly adjusted for the call to succeed.
-In the Makefile play with "-lthr" and without.
Comment 7 rsecor 2011-01-09 04:25:31 UTC
Sounding more and more like a configuration change in mysql from 5.1 to =
5.5 that must be addressed in the way the port configures it for =
compiling.

See the mysql bug report for more information:
http://bugs.mysql.com/bug.php?id=3D59243=
Comment 8 dfilter service freebsd_committer freebsd_triage 2011-01-09 12:29:24 UTC
ale         2011-01-09 12:29:19 UTC

  FreeBSD ports repository

  Modified files:
    databases/mysql55-client Makefile 
    databases/mysql55-server Makefile 
  Added files:
    databases/mysql55-client/files patch-include_my_pthread.h 
    databases/mysql55-server/files patch-include_my_pthread.h 
  Log:
  Fix mysqlclient library in single-threaded applications,
  by correctly implementing pthread_once (see PR threads/150959).
  While I'm here, replace CONFLICTS with CONFLICTS_INSTALL.
  Bump PORTREVISION.
  
  PR:             ports/153588
  Submitted by:   Richard Anthony Secor <rsecor@seqlogic.com>
  
  Revision  Changes    Path
  1.105     +1 -1      ports/databases/mysql55-client/Makefile
  1.1       +14 -0     ports/databases/mysql55-client/files/patch-include_my_pthread.h (new)
  1.270     +2 -2      ports/databases/mysql55-server/Makefile
  1.1       +14 -0     ports/databases/mysql55-server/files/patch-include_my_pthread.h (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 9 Alex Dupre freebsd_committer freebsd_triage 2011-01-09 12:29:30 UTC
State Changed
From-To: open->closed

A patch addressing the issue has been committed, thanks.