码迷,mamicode.com
首页 > 数据库 > 详细

mysql设置编码为UTF8,设置表为UTF8。

时间:2016-02-15 16:13:23      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:

1.设置编码为UTF-8

set character_set_client = utf8;

set character_set_server = utf8;

set character_set_connection = utf8;

set character_set_database = utf8;

set character_set_results = utf8;

set collation_connection = utf8_general_ci;

set collation_database = utf8_general_ci;

set collation_server = utf8_general_ci;

 

 

2.设置表为UTF-8

alter table tb_anniversary convert to character set utf8;

  

3.另外新建数据库时,设置库为UTF-8

create database app_relation character set utf8; 

 

 

mysql设置编码为UTF8,设置表为UTF8。

标签:

原文地址:http://www.cnblogs.com/youyuan1980/p/5190544.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!