這個是我在Linux上首次安裝時的字符集狀況 mysql
Server version: 5.6.29 MySQL Community Server (GPL) sql
由於之後須要插入中文,因此編碼須要設置成utf8,我主要經過命令行的方式。 編碼
show variables like 'character_set_%'; spa
mysql> set character_set_client=utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> set character_set_connection=utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> set character_set_database=utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> set character_set_results=utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> set character_set_server=utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> set character_set_system=utf8;
Query OK, 0 rows affected (0.01 sec) 命令行
用這些就能夠了 server