Home > Database > Mysql Tutorial > mysql重装后出现乱码设置为utf8可解决_MySQL

mysql重装后出现乱码设置为utf8可解决_MySQL

WBOY
Release: 2016-06-01 13:25:16
Original
860 people have browsed it

bitsCN.com 查看当前连接系统参数:SHOW VARIABLES LIKE '%char%';

mysql> show variables like 'char%';
+--------------------------+----------------
| Variable_name | Value
+--------------------------+----------------
| character_set_client | gbk
| character_set_connection | gbk
| character_set_database | latin1
| character_set_filesystem | binary
| character_set_results | gbk
| character_set_server | latin1
| character_set_system | utf8
| character_sets_dir | C:/

+--------------------------+----------------
8 rows in set (0.00 sec)
mysql>

只能在配置文件中将database 和 server 字符集 设置为utf8 ,否则不起作用

在命令行 :停止命令:net stop mysql

启动命令:net start mysql
mysql核心配置文件 my.ini

[mysql] 主要配置命令行客户端参数 default-character-set=utf8 ---- 影响 client、connection、result
[mysqld] 配置服务器参数 character-set-server=utf8 ----- 影响 database server

mysql添加function函数的时候 先设置 set global log_bin_trust_function_creators=1; 指定参数 否则创建不成功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