PDA

View Full Version : How to set default charset?



Artik
11-06-2006, 06:41 AM
Hello!
Please, help me to set default charset to cp1251 (or windows 1251) to MySQL db. I need to upload texts in Russian, but all characters turn into "?" because the current setting is UTF8.
Tnanks,
Artik
nova-consulting.org

bill2006
11-10-2006, 05:03 AM
Go to this post (http://www.vodahost.com/vodatalk/bluevoda-tips-tricks-shortcuts/8127-bluevoda-using-different-languages.html?highlight=language) by Brad.

navaldesign
11-10-2006, 08:01 AM
????

to change the default chr set in MySQL you need to act on the collation of the fields

Artik
11-13-2006, 06:45 AM
Can't understand. What exactly should I do? Is it possible to set default chr set in MySQL from the cPanel? I looked for the my.cn file from the File Manager but could not find it. How else can I change settings?

Artik

navaldesign
11-13-2006, 08:27 AM
These are the default character sets for the databases on VH servers:
latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5

If you need to add some chr set, go in your CP, Click on the MySQL section, select your specific DB, then run a querry according to the instruction that you find in

10.3.1. Server Character Set and Collation (http://dev.mysql.com/doc/refman/4.1/en/charset-server.html)
10.3.2. Database Character Set and Collation (http://dev.mysql.com/doc/refman/4.1/en/charset-database.html)
10.3.3. Table Character Set and Collation (http://dev.mysql.com/doc/refman/4.1/en/charset-table.html)
10.3.4. Column Character Set and Collation (http://dev.mysql.com/doc/refman/4.1/en/charset-column.html)
10.3.5. Character String Literal Character Set and Collation (http://dev.mysql.com/doc/refman/4.1/en/charset-literal.html)
10.3.6. National Character Set (http://dev.mysql.com/doc/refman/4.1/en/charset-national.html)
10.3.7. Examples of Character Set and Collation Assignment (http://dev.mysql.com/doc/refman/4.1/en/charset-examples.html)
10.3.8. Compatibility with Other DBMSs (http://dev.mysql.com/doc/refman/4.1/en/charset-compatibility.html)

More specific:
10.10. Character Sets and Collations That MySQL Supports (http://dev.mysql.com/doc/refman/4.1/en/charset-charsets.html)
10.10.1. Unicode Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-unicode-sets.html)
10.10.2. West European Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-we-sets.html)
10.10.3. Central European Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-ce-sets.html)
10.10.4. South European and Middle East Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-se-me-sets.html)
10.10.5. ****** Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-******-sets.html) 10.10.6. Cyrillic Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-cyrillic-sets.html)
10.10.7. Asian Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-asian-sets.html)

jjj0923
03-04-2007, 11:30 PM
These are the default character sets for the databases on VH servers:
latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5

If you need to add some chr set, go in your CP, Click on the MySQL section, select your specific DB, then run a querry according to the instruction that you find in

10.3.1. Server Character Set and Collation (http://dev.mysql.com/doc/refman/4.1/en/charset-server.html)
10.3.2. Database Character Set and Collation (http://dev.mysql.com/doc/refman/4.1/en/charset-database.html)
10.3.3. Table Character Set and Collation (http://dev.mysql.com/doc/refman/4.1/en/charset-table.html)
10.3.4. Column Character Set and Collation (http://dev.mysql.com/doc/refman/4.1/en/charset-column.html)
10.3.5. Character String Literal Character Set and Collation (http://dev.mysql.com/doc/refman/4.1/en/charset-literal.html)
10.3.6. National Character Set (http://dev.mysql.com/doc/refman/4.1/en/charset-national.html)
10.3.7. Examples of Character Set and Collation Assignment (http://dev.mysql.com/doc/refman/4.1/en/charset-examples.html)
10.3.8. Compatibility with Other DBMSs (http://dev.mysql.com/doc/refman/4.1/en/charset-compatibility.html)

More specific:
10.10. Character Sets and Collations That MySQL Supports (http://dev.mysql.com/doc/refman/4.1/en/charset-charsets.html)
10.10.1. Unicode Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-unicode-sets.html)
10.10.2. West European Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-we-sets.html)
10.10.3. Central European Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-ce-sets.html)
10.10.4. South European and Middle East Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-se-me-sets.html)
10.10.5. ****** Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-******-sets.html) 10.10.6. Cyrillic Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-cyrillic-sets.html)
10.10.7. Asian Character Sets (http://dev.mysql.com/doc/refman/4.1/en/charset-asian-sets.html)

I have a website I need to move that has both asp and php pages. the mysqk database in use on the site has a character set of latin1

I have checked with 3 different web hosting companies and none of them support latin1 - phpmyadmin gives ans error message when trying to execute this sql:

CREATE TABLE `access` (
`userid` int(10) unsigned NOT NULL default '0',
`forumid` smallint(5) unsigned NOT NULL default '0',
`accessmask` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`userid`,`forumid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

#
# Dumping data for table `access`
#

INSERT INTO `access` VALUES (321, 3, 1);
INSERT INTO `access` VALUES (321, 4, 1);
INSERT INTO `access` VALUES (321, 5, 1);
INSERT INTO `access` VALUES (321, 6, 1);
INSERT INTO `access` VALUES (321, 7, 1);

can your servers handle this?
can you support both php and asp pages on the same website?

thanks

navaldesign
03-04-2007, 11:39 PM
Sorry, no asp. We have Linux servers, so no ASP pages are supported.

Our MySQL databases can be setup to have Latin1 collation directly from phpMyAdmin.