Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.9Mb
PDF (A4) - 37.9Mb
PDF (RPM) - 32.8Mb
HTML Download (TGZ) - 8.0Mb
HTML Download (Zip) - 8.1Mb
HTML Download (RPM) - 6.9Mb
Man Pages (TGZ) - 132.7Kb
Man Pages (Zip) - 189.0Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

10.10.6 Cyrillic Character Sets

The Cyrillic character sets and collations are for use with Belarusian, Bulgarian, Russian, Ukrainian, and Serbian (Cyrillic) languages.

  • cp1251 (Windows Cyrillic) collations:

    • cp1251_bin

    • cp1251_bulgarian_ci

    • cp1251_general_ci (default)

    • cp1251_general_cs

    • cp1251_ukrainian_ci

  • cp866 (DOS Russian) collations:

    • cp866_bin

    • cp866_general_ci (default)

  • koi8r (KOI8-R Relcom Russian) collations:

    • koi8r_bin

    • koi8r_general_ci (default)

  • koi8u (KOI8-U Ukrainian) collations:

    • koi8u_bin

    • koi8u_general_ci (default)

User Comments
  Posted by Alexander Kushnirenko on August 5, 2004
Imagine you have a table which has column 'name' in UTF-8 and column 'namew' in cp1251. Both columns have some cyrillic information in it. You use xterm with koi8r character set to work with your database. There are 3 steps you need to do to work with your table.

1. alter your table to include information about character sets that are used in your table (see section Converting 4.0 Character Columns to 4.1 Format). Most of us have to do this step because usually you inherit your tables from MySQL 4.0 If you created your table and specified character sets there is no need to do this step. Verify your actions using SHOW FULL COLUMNS FROM table_name.

2. SET NAMES KOI8R. (see section Connection Character Sets and Collations for details). It explains that your I/O is done in KOI8R

3. SELECT name,namew FROM table_name;
Database will convert UTF8,cp1251--> koi8r for you and will produce results in koi8r character set that you can see on your terminal. You can also do
UPDATE table_name SET name='koi8r-typed-russian-word'
and database will convert your string that you typed in koi8r into UTF-8 format and store in your table.

  Posted by milos korac on March 31, 2005
so, i have a real estate web site and we have database in 5 languages, one of them is russian. So why simple, when it can be compicated? First i gave my secretary access to myadmin so she can work with russian (Natasha), and we had trouble with russian again search machines, topics, forums etc. and it was the point with encoding ex. KOI8-R as it was used on Unix, its a table with a russian characters and on the top andon the left side you have a characters that are encoding one russian letter...
| koi8r | KOI8-R Relcom Russian | koi8r_general_ci | 1 | 

maybe to make test with this:



if (!
$link) { 
printf("Connect failed: %s\n"mysql_error()); 

$charset mysql_client_encoding($link); 

printf ("Current character set is %s\n",$charset); 




  Posted by Vasko Tsintsev on November 29, 2005
It's true about the results like "???????" . In versions of PHP >5.0.* and MySQL 4.1.14 , and if you try to get result in cyrillic , you will see just "????". There is sample solution : immediately after mysql_connect() , and mysql_select_db() add this lines :
mysql_query("SET NAMES CP1251");
Thats all ... ! Good luck ... !
Sign Up Login You must be logged in to post a comment.