You are here:Home»KB»Programming»MySQL»MySQL database migration: latin1 to utf8 conversion
Tuesday, 24 February 2009 12:10

MySQL database migration: latin1 to utf8 conversion

Written by

If you have created a website and forgot to set the charset to UTF-8 and it has defaulted to Latin-1 then follow the instruictions below.

  1. First make a back up of the database.
  2. Find the line(s) that contains "SET NAMES latin1" and change that to "SET NAMES utf8".
  3. Then, look at the table definition(s) and change "DEFAULT CHARSET=latin1" to "DEFAULT CHARSET=utf8".
  4. Save the database
  5. Set operations in phpmyadmin to UTF-8 (utf8_general_ci),
  6. Reimport the database to the website
Read 1096 times Last modified on Tuesday, 08 December 2015 20:02