MySQL – change the collation for database and all table columns

Changing the collation for a table will only set the collation for the next column that’s added. To change all of the existing columns to the new collation :

ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci

ALTER DATABASE dbname COLLATE utf8_general_ci