$sudo vim /etc/mysql/my.cnf #运行配置文件#修改配置文件[client]
default-character-set = utf8
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs # The following values assume you have at least 32M ram # This was formally known as [safe_mysqld]. Both versions are currently parsed.[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice= 0
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
init_connect ='SET NAMES utf8'
default-time-zone ='+8:00'# Instead of skip-networking the default is now to listen only on# localhost which is more compatible and is not less secure. #bind-address = 127.0.0.1