How to change collation of database, table, column?

user158469 picture user158469 · Aug 18, 2009 · Viewed 270.4k times · Source

The database is latin1_general_ci now and I want to change collation to utf8mb4_general_ci.

Is there any setting in PhpMyAdmin to change collation of database, table, column? Rather than changing one by one?

Answer

Quassnoi picture Quassnoi · Aug 18, 2009

You need to either convert each table individually:

ALTER TABLE mytable CONVERT TO CHARACTER SET utf8mb4 

(this will convert the columns just as well), or export the database with latin1 and import it back with utf8mb4.