1. 程式人生 > >mysql:unknown variable 'default-character-set=utf8'

mysql:unknown variable 'default-character-set=utf8'

div local rep art file tin my.cnf server OS

1、修改my.cnf後,執行 service mysql restart 重啟數據庫失敗

service mysql restart
Shutting down MySQL.. SUCCESS! 
Starting MySQL... ERROR! The server quit without updating PID file (/usr/local/mysql/data/VM_0_12_centos.pid)

2、查看日誌:

cat VM_0_12_centos.err |grep ERROR
2018-02-27 22:33:50 923 [ERROR] /usr/local/mysql/bin/mysqld: unknown variable ‘default-character-set=utf8‘
2018-02-27 22:33:50 923 [ERROR] Aborting

3、很明顯是沒有default-character-set這個變量

4、查了下資料得知 character_set_server來取代 default-character-set

5、修改my.cnf。將default-character-set=utf8 換成character_set_server=utf8。重啟數據庫,啟動成功。

mysql:unknown variable 'default-character-set=utf8'