Home  >  Article  >  Database  >  修改mysql默认编码的方法

修改mysql默认编码的方法

WBOY
WBOYOriginal
2016-06-07 17:51:431199browse

修改mysql默认编码方法特别简单我们这里分别介绍了linux和windows下修改默认编码的方法。

Windows系统下最简单最彻底的方法:
1、中止MySQL服务
2、在MySQL的安装目录下找到my.ini,如果没有就把my-medium.ini复制为一个my.ini即可
3、打开my.ini以后,在[client]和[mysqld]下面均加上default-character-set=utf8,保存并关闭
4、启动MySQL服务


Unix平台

下的mysql配置文件是my.cnf,一般是/etc/my.cnf,如果找不到可以用find命令找一下:

find / -iname my.cnf

在这个文件里面加上

default-character-set=gbk #或gb2312,big5,utf8

然后重新启动mysql


三. 配置排序字符集

myisamchk -r -q --set-character-set=charset

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn