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.

Web Projects Consulting
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.