Skip to content

Instantly share code, notes, and snippets.

@shui
Last active August 12, 2017 02:53
Show Gist options
  • Save shui/3b8c890fc5c0e219abecbc680c8c2f14 to your computer and use it in GitHub Desktop.
Save shui/3b8c890fc5c0e219abecbc680c8c2f14 to your computer and use it in GitHub Desktop.
修改MySQL的字符集编码和时区

$ sudo vim /etc/mysql/my.cnf,加入下面几行。

[mysqld]
character-set-server = utf8
collation-server = utf8_general_ci
default-time_zone = '+8:00'                                                                                                                                                                                    

[client]
default-character-set = utf8
 
[mysql]
default-character-set = utf8
prompt = \\u@\\h[\\d]>\\_

重启mysql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment