Mysql modify my.ini error solution: first change the mysql default encoding to utf8mb4, and modify the [my.ini] configuration; then modify the variable, and check whether the setting is successful.
More related free learning recommendations: mysql tutorial(video)
Mysql modify my.ini error solution:
Change mysql default encoding to utf8mb4 The process is as follows:
-
Close mysql service
-
Modify my.ini configuration file (the modification method is written below), pay attention to save it as ANSI code
-
Start the mysql service
-
Modify the variable, (write below the setting method)
-
Check whether the setting is successful, (write below the check method)
Modify my.ini configuration: (you only need to pay attention to the utf8mb4 part of the configuration, other parts of the configuration do not need to refer to mine)
[mysqld] character-set-client-handshake = FALSE character-set-server=utf8mb4 collation-server=utf8mb4_unicode_ci init_cOnnect='SET NAMES utf8mb4' sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION" default_storage_engine=innodb innodb_buffer_pool_size=1000M innodb_log_file_size=50M innodb_file_format=barracuda innodb_file_per_table=true innodb_large_prefix=true max_allowed_packet=500M # Set the installation directory of mysql basedir=D:\mysql-5.6.40-winx64 # Set the data storage directory of the mysql database datadir=D:\mysql-5.6.40-winx64\data # Maximum number of connections allowed max_cOnconnections=200 [mysql] default-character-set = utf8mb4 [client] default-character-set = utf8mb4
Modify variable method:
Execute the following sql on the line
set character_set_client = utf8mb4; set character_set_cOnnection= utf8mb4; set character_set_database = utf8mb4; set character_set_results = utf8mb4;
Check setting success method:
execute sql
SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';
The results are as follows: success
The above is the detailed content of mysql modifying my.ini and reporting errors. For more information, please pay attention to other related articles on 1024programmer.com!