MySQL green version setting code and 1067 error details

MySQL green version setting code and 1067 error details

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.

  • character_set_client: The data you send must be consistent with the encoding specified by the client! ! ! The server will use this code to interpret the data sent by the client;
  • character_set_connection: This encoding is consistent with the client! This encoding will not result in garbled characters! When a query statement is executed, the data sent by the client will first be converted into the encoding specified by the connection. However, as long as the data sent by the client is consistent with the encoding specified by the client, there will be no problem with the conversion;
  • character_set_database: The default encoding of the database. If no encoding is specified when creating a database, the database encoding is used by default;
  • character_set_server: MySQL server default encoding;
  • character_set_results: The encoding of the response, that is, the encoding of the query results returned to the client. This means that the client must use the encoding specified by result to decode;
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.
Fill in this sentence:

這里寫圖片描述

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:
  • How to install MySQL 5.7.17 and set the encoding to utf8 in Windows
  • The default encoding of mysql is UTF-8. You can modify my.ini to achieve this.
  • View, create and modify the encoding format of database and data table in MySQL
  • How to use SQL statements to view the encoding method of a table in MySQL
  • How to view and modify character encoding in MySQL
  • Forget the root password and modify the default encoding of MySQL in Linux
  • How to modify the default character set encoding in MySQL
  • MySQL character encoding setting method

<<:  Using Docker Enterprise Edition to build your own private registry server

>>:  Five ways to traverse JavaScript arrays

Recommend

How to connect to MySQL visualization tool Navicat

After installing Navicat The following error may ...

Detailed explanation of MySQL redo log (redo log) and rollback log (undo logo)

Preface: The previous article described several c...

Excel export always fails in docker environment

Excel export always fails in the docker environme...

Problems installing TensorRT in docker container

Uninstall the installed version on Ubuntu: sudo a...

How to implement the paging function of MyBatis interceptor

How to implement the paging function of MyBatis i...

When is it appropriate to use dl, dt, and dd?

dl:Definition list Definition List dt:Definition t...

JavaScript canvas realizes the effect of nine-square grid cutting

This article shares the specific code of canvas t...

Example of automatic import method of vue3.0 common components

1. Prerequisites We use the require.context metho...

Detailed explanation of how to connect Java to Mysql version 8.0.18

Regarding the connection method between Java and ...

Solve the problem of managing containers with Docker Compose

In Docker's design, a container runs only one...

In-depth explanation of binlog in MySQL 8.0

1 Introduction Binary log records SQL statements ...

HTML 5.1 learning: 14 new features and application examples

Preface As we all know, HTML5 belongs to the Worl...