PDA

View Full Version : MySQL Error: Unknown character set: 'cp1251'



Dmitry Kondrashov
March 23, 2012, 01:13 AM
Hi,
I have a MySQL error occurred during installation at the stage of creating tables:


Can not run sql query.
Error: Unknown character set: 'cp1251'
Query: CREATE TABLE `fca_languages` (`ID` int(11) NOT NULL AUTO_INCREMENT,`Code` varchar(255) NOT NULL DEFAULT '',`Direction` enum('ltr','rtl') NOT NULL DEFAULT 'ltr',`Key` varchar(255) NOT NULL DEFAULT '',`Status` enum('active','approval','trash') NOT NULL DEFAULT 'approval',`Date_format` varchar(100) NOT NULL DEFAULT '',PRIMARY KEY (`ID`),KEY `Code` (`Code`)) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=46 ;
Can not run sql query.
Error: Table 'mroot.fca_languages' doesn't exist
Query: INSERT INTO `fca_languages` (`Code`, `Direction`, `Key`, `Status`, `Date_format`) VALUES('en', 'ltr', 'english', 'active', '%b %d, %Y');
Can not run sql query.
Error: Unknown character set: 'cp1251'
Query: CREATE TABLE `fca_messages` (`ID` int(11) NOT NULL AUTO_INCREMENT,`From` int(11) NOT NULL DEFAULT '0',`To` int(11) NOT NULL DEFAULT '0',`Admin` int(7) NOT NULL,`Message` text CHARACTER SET cp1251 NOT NULL,`Date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',`Status` enum('new','readed') CHARACTER SET cp1251 NOT NULL DEFAULT 'new',`Remove` set('from','to') NOT NULL DEFAULT '',PRIMARY KEY (`ID`),KEY `From` (`From`,`To`)) DEFAULT CHARSET=utf8;

The MySQL on Fatcow hosting does not support 'cp1251'... ?!?!

MySQL 5.1.53 server default variables and settings:


character set client utf8
(Global value) latin1
character set connection utf8
(Global value) latin1
character set database latin1
character set filesystem binary
character set results utf8
(Global value) latin1
character set server latin1
character set system utf8
character sets dir /usr/local/mysql-5.1.53-linux-x86_64-glibc23/share/charsets/
collation connection utf8_unicode_ci
(Global value) latin1_swedish_ci
collation database latin1_swedish_ci
collation server latin1_swedish_ci

Why not make a script based on UTF8 charset?
On which side I can solve question? From the hosting itself (php.ini, my.cnf) or modify the script with the probability of a problem with the databases in the future?
I understand that the problem in my hosting. I tried other hostings where the script worked without any problems.
But unfortunately I can not give it up because I have a good account on it.

Dmitry Kondrashov
March 23, 2012, 01:40 AM
Supported character sets and collations:


cp1251 (Windows Cyrillic)
cp1251_bin Cyrillic (multilingual), Binary
cp1251_bulgarian_ci Bulgarian, case-insensitive
cp1251_general_ci Cyrillic (multilingual), case-insensitive
cp1251_general_cs Cyrillic (multilingual), case-sensitive
cp1251_ukrainian_ci Ukrainian, case-insensitive

Dmitry Kondrashov
March 23, 2012, 06:26 AM
Problem solved by fix in install/mysql/dump.sql we've changed from cp1251 to utf8

John
March 23, 2012, 11:02 AM
Hello Dmitry,
>>Why not make a script based on UTF8 charset?
Actually it was our goal to base the software on UTF8, just one table and two fields finally caught cp1251 :(
any way now all database based on UTF8.

>>On which side I can solve question? From the hosting itself (php.ini, my.cnf) or modify the script
>>with the probability of a problem with the databases in the future?
You should not meet such problems again.

Also I have reply your previous thread to protect fatcow hosting :)
http://www.flynax.com/forum/showthread.php?316-Do-not-use-Fatcow-hosting&p=969#post969

John