Home > Database > Mysql Tutorial > body text

更改MySQL的默认字符集方法集锦_MySQL

WBOY
Release: 2016-06-01 13:37:35
Original
1019 people have browsed it

bitsCN.com


更改MySQL的默认字符集方法集锦

 

方法1、 用 SET 语法来指定,不加 “GLOBAL” 的话就只对本次会话有效

SET [GLOBAL] character_set_client = utf8;

SET [GLOBAL] character_set_connection = utf8;

SET [GLOBAL] character_set_database = utf8;

SET [GLOBAL] character_set_results = utf8;

SET [GLOBAL] character_set_server = utf8;

 

方法2、 也用SET语法,只对本次会话有效

 

SET NAMES ‘utf8′;

方法3、 直接修改 my.ini,增加一行内容,然后重启 MySQL,使之全局生效

 

default-character-set = utf8
 

bitsCN.com
Related labels:
use
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!