5
我在我的Ubuntu 14.04上安裝了MySQL 5.7.8。不能更改MySQL 5.7中的字符集(從拉丁到utf8)
但我無法修改MySQL的默認字符集。我想將charset更改爲utf8。
我在互聯網上搜索並查看了很多文章,但是我嘗試的每種方法都不適用於我。
我已在/etc/mysql/my.cnf中添加'character-set-server = utf8'和'collation-server = utf8_general_ci'。但它不工作...
如何更改我的MySQL字符集?請回答我!
狀態在MySQL
Connection: Localhost via UNIX socket Server characterset: latin1 Db characterset: latin1 Client characterset: utf8 Conn. characterset: utf8 UNIX socket: /var/run/mysqld/mysqld.sock Uptime: 1 min 24 sec
顯示變量,如 'C%'
| character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | check_proxy_users | OFF | | collation_connection | utf8_general_ci | | collation_database | latin1_swedish_ci | | collation_server | latin1_swedish_ci | | completion_type | NO_CHAIN | | concurrent_insert | AUTO | | connect_timeout | 10 | | core_file | OFF |
my.cnf中(在/ etc/MySQL的)
[mysqld] # # * Basic Settings # character-set-server=utf8 collation-server=utf8_general_ci user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp lc-messages-dir = /usr/share/mysql skip-external-locking character-set-server=utf8 collation-server=utf8_general_ci init_connect=set collation_connection=utf8_general_ci init_connect=set names utf8 character-set-client-handshake=FALSE