Web Projects Consulting

Mass Change A Collation for Table Fields in MySQL

LAMP programmers often come across MySQL database dumps or existing tables that have wrong collations or where table fields have different collations even within one single table.

To fix the problem, run the below query for each table under question. Of course, the collation values are on your choice.

ALTER TABLE some_table CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.