The solution to the error reported by mysql when modifying my.ini: First change the default encoding of mysql to utf8mb4 and modify the [my.ini] configuration; then modify the variables and check whether the setting is successful.
##More related free learning recommendations: mysql tutorial(Video)
Solution to the error reported by mysql when modifying my.ini:
The process of changing the default encoding of mysql to utf8mb4 As follows:
Modify my.ini configuration: (You only need to pay attention to the utf8mb4 part of the configuration, and other parts of the configuration No 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 # 设置mysql的安装目录 basedir=D:\mysql-5.6.40-winx64 # 设置mysql数据库的数据的存放目录 datadir=D:\mysql-5.6.40-winx64\data # 允许最大连接数 max_connections=200 [mysql] default-character-set = utf8mb4 [client] default-character-set = utf8mb4
Modify variable method:
Just execute the following sqlset character_set_client = utf8mb4; set character_set_connection = utf8mb4; set character_set_database = utf8mb4; set character_set_results = utf8mb4;
Check the successful setting method:
Execute sqlSHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';The results are as follows and the result is successful
The above is the detailed content of What should I do if mysql reports an error when modifying my.ini?. For more information, please follow other related articles on the PHP Chinese website!