Posted By

ironcrema on 03/30/15


Tagged

character set to convert utf-8 columns


Versions (?)

Mysql - Convertir todas las columnas en colación utf8


 / Published in: MySQL
 

Consulta que permite convertir todas las tablas en colación utf8

  1. SELECT CONCAT('alter table ', TABLE_NAME , ' convert to character set utf8 collate utf8_unicode_ci;')
  2. FROM information_schema.TABLES
  3. WHERE table_schema = 'db_clienteincognito'
  4. AND TABLE_COLLATION <> 'utf8_unicode_ci'
  5.  
  6. /*verify all columns */
  7. SELECT table_name, column_name, data_type, character_set_name, collation_name FROM information_schema.`COLUMNS` WHERE table_schema = "db_clienteincognito";

Report this snippet  

You need to login to post a comment.