Skip to content

Instantly share code, notes, and snippets.

@rusllonrails
Created December 30, 2012 20:14
Show Gist options
  • Select an option

  • Save rusllonrails/4414847 to your computer and use it in GitHub Desktop.

Select an option

Save rusllonrails/4414847 to your computer and use it in GitHub Desktop.
MYSQL support UTF-8
below is my configure to support utf8:
[client]
default-character-set=utf8
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
@in-78
Copy link
Copy Markdown

in-78 commented Apr 3, 2013

restart mysql server after change my.cnf:
sudo service mysql restart

if database already exist:
mysql> alter database DATABASE default character set utf8;
mysql> alter database DATABASE default collate utf8_general_ci;

if table already exist:
mysql> alter table table_name convert to character set utf8 collate utf8_general_ci;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment