Tuesday, April 1, 2014

MySQL change character set

Change character set in MySQL.

1. Change character set in MySQL console.
  • check default character set.
> show variables like 'char%';
  • Change character set to the character set you want, for example, 'euckr'.
> set character set euckr;

2. If your talbes had been already created before you changed the character set, you might need to change the default character sets of the tables.
  • Check character set of your table.
> show create table [your databasename].[your tablename];
  • Change character set of the table.
> alter table [your databasename].[your tablename] convert to charset euckr;
> alter table [your databasename].[your tablename] convert to charset utf8;

No comments:

Post a Comment