Home > Database > Mysql Tutorial > 精简mysql中文乱码解决方法_MySQL

精简mysql中文乱码解决方法_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:54:38
Original
877 people have browsed it

一: windows系统下mysql中文显示乱码最简解决方法

mysql> set names gb2312; 然后敲回车ok!

前提是安装的时候选utf8编码格式安装。

二:linux系统下mysql中文乱码最简解决方法

在/etc/mysql/目录下,修改文件my.cnf

主要配置文件修改有两处:

到客户端配置[client] 在下面添加

### 默认字符集为utf8

default-character-set=utf8

在找到[mysqld] 添加

### 默认字符集为utf8

default-character-set=utf8

### (设定连接mysql数据库时使用utf8编码,以让mysql数据库为utf8运行)

init_connect='SET NAMES utf8' 

修改后重新启动,以后都是OK。

Related labels:
Statement of this Website
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template