---
title: "MySQL 5.6版本default-character-set=utf8报错问题"
author: "jsntghf"
date: "2017-02-17T11:18:50Z"
tags: ["MySQL"]
categories: ["数据库"]
slug: "mysql-5-6-default-character-set-utf8"
draft: false
lastmod: "2017-02-17T11:18:50Z"
id: 2357618
url: "https://eric-gao.iteye.com/blog/2357618"
---

MySQL 版本：5.6.13

OS：CentOS

 

在5.1版本时，为了解决中文乱码问题，设置默认字符集为utf8时，在my.cnf内的 \[mysql] 和 \[mysqld] 中都是写default-character-set=utf8

 

5.5版本开始， \[mysql] 项内可以这么写，\[mysqld] 项内这么写在启动MySQL服务时会有1067错误，必须要写成character-set-server=utf8