Description:
When I try to connect to MySQL server in PHP (via mysql or mysqli), every time I get response:
Can't initialize character set cp1250 (path: /usr/local/share/mysql/charsets/)
But in mentioned path there are definitelly character sets including Index.xml and MySQL is compilet with --with-charset=cp1250 and --with-extra-charsets=complex (tried also --with-extra-charsets=all, but no difference).
Connecting with mysql client and proftpd's mod_sql works fine.
How to repeat:
Install MySQL 5.0.19 on FreeBSD from ports, also install Apache 2.0 and PHP 5.1.2 and try connect to MySQL by this simple php command:
$MySQL_spojeni = MySQL_Connect("ip.address", "user", "pass");
as result you will get
Warning: mysql_connect() [function.mysql-connect]: Can't initialize character set cp1250 (path: /usr/local/share/mysql/charsets/)
Used settings for MySQL port:
WITH_CHARSET=cp1250
WITH_XCHARSET=all
WITH_COLLATION=cp1250_czech_cs
BUILD_OPTIMIZED=yes
WITH_ARCHIVE=yes
Setting for PHP port:
WITHOUT_DEBUG=true
WITHOUT_MULTIBYTE=true
WITHOUT_IPV6=true
Settings for PHP port:
WITHOUT_BCMATH=true
WITH_BZ2=true
WITH_CALENDAR=true
WITH_CTYPE=true
WITH_CURL=true
WITHOUT_DBA=true
WITHOUT_DBASE=true
WITHOUT_DOM=true
WITH_EXIF=true
WITH_FILEINFO=true
WITHOUT_FILEPRO=true
WITHOUT_FRIBIDI=true
WITH_FTP=true
WITH_GD=true
WITH_GETTEXT=true
WITHOUT_GMP=true
WITH_ICONV=true
WITH_IMAGICK=true
WITH_IMAP=true
WITHOUT_INTERBASE=true
WITHOUT_LDAP=true
WITH_MBSTRING=true
WITH_MCRYPT=true
WITH_MHASH=true
WITHOUT_MING=true
WITHOUT_MSSQL=true
WITH_MYSQL=true
WITH_MYSQLI=true
WITHOUT_NCURSES=true
WITHOUT_ODBC=true
WITH_OPENSSL=true
WITHOUT_PANDA=true
WITHOUT_PCNTL=true
WITH_PCRE=true
WITH_PDF=true
WITHOUT_PGSQL=true
WITH_POSIX=true
WITH_PSPELL=true
WITHOUT_READLINE=true
WITHOUT_RECODE=true
WITH_SESSION=true
WITHOUT_SHMOP=true
WITH_SIMPLEXML=true
WITHOUT_SNMP=true
WITHOUT_SOAP=true
WITHOUT_SOCKETS=true
WITH_SQLITE=true
WITHOUT_SYBASE_CT=true
WITH_SYSVMSG=true
WITH_SYSVSEM=true
WITH_SYSVSHM=true
WITHOUT_TIDY=true
WITH_TOKENIZER=true
WITHOUT_WDDX=true
WITH_XML=true
WITH_XMLREADER=true
WITHOUT_XMLRPC=true
WITH_XMLWRITER=true
WITHOUT_XSL=true
WITHOUT_YAZ=true
WITH_ZIP=true
WITH_ZLIB=true
Suggested fix:
dunno