Mysql - Convertir todas las columnas en colación utf8


/ Published in: MySQL
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.