Home > Database > Mysql Tutorial > 设置MySql5.5数据库的字符编码为UTF8,解决中文乱码问题_MySQL

设置MySql5.5数据库的字符编码为UTF8,解决中文乱码问题_MySQL

WBOY
Release: 2016-06-01 13:41:18
Original
1184 people have browsed it

bitsCN.com
设置MySql5.5数据库的字符编码为UTF8,解决中文乱码问题 1.在mysql压缩目录下,有一堆的参数配置文件,比如:my-small.ini,复制一下这个文件,自己改下名字,比如叫:my.ini   2.打开my.ini文件,增加如下参数:  [client]:增加default-character-set=utf8参数   [client]  #password = [your_password]  port = 3306  socket = /tmp/mysql.sock  default-character-set=utf8    [mysqld]:增加如下3个参数     [mysqld]  default-storage-engine=INNODB  character-set-server=utf8  collation-server=utf8_general_ci   # generic configuration options  port = 3306  socket = /tmp/mysql.sock   3.设置完成后,重启下mysql服务   4.连接上你的数据库之后,输入命令:SHOW VARIABLES LIKE '%char%';即可查看到现在你的数据库所使用的字符集了
  bitsCN.com

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template