MySQL green version setting code, and 1067 error View MySQL encoding SHOW VARIABLES LIKE 'char%'; Because the character set was specified as UTF8 during installation, all encodings are UTF8.
Modify character_set_client, character_set_results, character_set_connection to GBK, There will be no garbled characters. But in fact, you only need to modify character_set_client and character_set_results. The console encoding can only be GBK and cannot be changed to UTF8, which causes a problem. The data sent by the client is GBK, and character_set_client is UTF8, which means that the client data will be garbled when it reaches the server. Since the console encoding cannot be changed, the only option is to change character_set_client to GBK. The data that the server sends to the client is encoded as character_set_result. If it is UTF8, garbled characters will appear when the console uses GBK decoding. Because the console encoding cannot be modified, the only option is to change character_set_result to GBK. Here is the overall configuration: # For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the # *** default location during installation, and will be replaced if you # *** upgrade to a newer version of MySQL. [mysqld] basedir = H:\MySQL datadir = H:\MySQL\data character_set_server = utf8 # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. # basedir = ..... # datadir = ..... # port = ..... # server_id = ..... # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [client] port=3306 default-character-set = gbk Error 1067 Be careful not to make mistakes in the configuration in my.ini. In fact, many of our 1067 errors are caused by mistakes in the my.ini configuration. Remark: In Windows 10, you can actually set default-character-set = utf8, and then there will be no garbled characters when performing operations in cmd. But in Windows 8.1 and Windows 7, the characters will be garbled. Therefore, in Windows 8.1 and Windows 7, default-character-set = gbk must be set to gbk Thank you for reading, I hope it can help you, thank you for your support of this site! You may also be interested in:
|
<<: Using Docker Enterprise Edition to build your own private registry server
>>: Five ways to traverse JavaScript arrays
After installing Navicat The following error may ...
Preface: The previous article described several c...
Excel export always fails in the docker environme...
The solution to the background tiling or border br...
Uninstall the installed version on Ubuntu: sudo a...
How to implement the paging function of MyBatis i...
First way: skip-grant-tables: Very useful mysql s...
dl:Definition list Definition List dt:Definition t...
This article shares the specific code of canvas t...
1. Prerequisites We use the require.context metho...
Regarding the connection method between Java and ...
In Docker's design, a container runs only one...
1 Introduction Binary log records SQL statements ...
1. Current date select DATE_SUB(curdate(),INTERVA...
Preface As we all know, HTML5 belongs to the Worl...