Linux下MySQL數據庫的my.cnf配置文件,解決中文亂碼問題

系統 CentOS 7.7html

MySQL - 5.7.28
文件放置目錄:/etc/
文件權限:644
解決問題:存儲中文數據亂碼mysql

 1 # For advice on how to change settings please see  2 # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
 3 # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
 4 # *** default location during install, and will be replaced if you  5 # *** upgrade to a newer version of MySQL.  6 
 7 [client]  8 default-character-set=utf8  9 
10 [mysql] 11 #auto-rehash 12 default-character-set = utf8 13 
14 [mysqld] 15 character_set_server=utf8 16 init_connect='SET NAMES utf8'
17 
18 # Remove leading # and set to the amount of RAM for the most important data 19 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. 20 # innodb_buffer_pool_size = 128M 21 
22 # Remove leading # to turn on a very important data integrity option: logging 23 # changes to the binary log between backups. 24 # log_bin 25 
26 # These are commonly set, remove the # and set as required. 27 # basedir = ..... 28 # datadir = ..... 29 # port = ..... 30 # server_id = ..... 31 # socket = ..... 32 
33 # Remove leading # to set options mainly useful for reporting servers. 34 # The server defaults are faster for transactions and fast SELECTs. 35 # Adjust sizes as needed, experiment to find the optimal values. 36 # join_buffer_size = 128M 37 # sort_buffer_size = 2M 38 # read_rnd_buffer_size = 2M 39 
40 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
相關文章
相關標籤/搜索