Character set disponibles en MySQL

MySQL

MySQL ofrece varios tipos de conjunto de carácteres (CHARACTER_SET), satisfaciendo así los mas variados proyectos.

Ver conjunto de carácteres soportados por el servidor MySQL

> SHOW CHARACTER SET;
+----------+-----------------------------+---------------------
| Charset  | Description                 | Default collation   
+----------+-----------------------------+--------------------
| big5     | Big5 Traditional Chinese    | big5_chinese_ci    
| dec8     | DEC West European           | dec8_swedish_ci    
| cp850    | DOS West European           | cp850_general_ci   
| hp8      | HP West European            | hp8_english_ci     
| koi8r    | KOI8-R Relcom Russian       | koi8r_general_ci   
| latin1   | cp1252 West European        | latin1_swedish_ci  
| latin2   | ISO 8859-2 Central European | latin2_general_ci  
| swe7     | 7bit Swedish                | swe7_swedish_ci    
| ascii    | US ASCII                    | ascii_general_ci   
....

Ver COLLATION disponible para un CHARACTER SET

> SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLLATIONS 
WHERE CHARACTER_SET_NAME = 'utf8';
+--------------------+
| COLLATION_NAME     |
+--------------------+
| utf8_general_ci    |
| utf8_bin           |
| utf8_unicode_ci    |
| utf8_icelandic_ci  |
| utf8_latvian_ci    |
| utf8_romanian_ci   |
| utf8_slovenian_ci  |
...

Ver COLLATION, CHARACTER_SET para una BD

> SELECT * from information_schema.SCHEMATA WHERE SCHEMA_NAME='librebyte';

+---------+--------------+-------------+----------------------------+-------------------------+
| CATALOG_NAME | SCHEMA_NAME | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | SQL_PATH |
+--------------+-------------+----------------------------+------------------------+----------+
| def          | librebyte   | utf8                       | utf8_general_ci        | NULL     |
+--------------+-------------+----------------------------+------------------------+----------+
1 row in set (0.00 sec)

Ver COLLATION, CHARACTER_SET para las columnas de una tabla determinada

Aqui tomamos como ejemplo la BD : Sakila

> SELECT COLUMN_NAME,COLLATION_NAME, CHARACTER_SET_NAME FROM 
INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'actor' AND 
TABLE_SCHEMA = 'sakila';
+-------------+-----------------+--------------------+
| COLUMN_NAME | COLLATION_NAME  | CHARACTER_SET_NAME |
+-------------+-----------------+--------------------+
| actor_id    | NULL            | NULL               |
| first_name  | utf8_general_ci | utf8               |
| last_name   | utf8_general_ci | utf8               |
| last_update | NULL            | NULL               |
+-------------+-----------------+--------------------+

Lecturas recomendadas

  • F. van der lan, Rick. SQL for MySQL Developers, Part III, Chapter 22.
YouTube video

Administrar MySQL desde la línea de comandos, 16 (18)

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.