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

Native JS to implement image carousel JS to implement small advertising plug-in

Recently I want to use native JS to implement som...

Detailed explanation of HTML form elements (Part 1)

HTML forms are used to collect different types of...

Basic usage of UNION and UNION ALL in MySQL

In the database, both UNION and UNION ALL keyword...

Detailed explanation of InnoDB storage files in MySQL

Physically speaking, an InnoDB table consists of ...

Basic tutorial on controlling Turtlebot3 mobile robot with ROS

Chinese Tutorial https://www.ncnynl.com/category/...

Analysis of Difficulties in Hot Standby of MySQL Database

I have previously introduced to you the configura...

Detailed explanation of how a SQL statement is executed in MySQL

Overview I have recently started learning MySQL r...

A brief understanding of the difference between MySQL union all and union

Union is a union operation on the data, excluding...

Implementation of Docker data volume operations

Getting Started with Data Volumes In the previous...

Detailed explanation of pid and socket in MySQL

Table of contents 1. Introduction to pid-file 2.S...

SQL injection vulnerability process example and solution

Code example: public class JDBCDemo3 { public sta...

Linux yum package management method

Introduction yum (Yellow dog Updater, Modified) i...

An example of how Vue implements four-level navigation and verification code

Effect: First create five vue interfaces 1.home.v...

How to solve the mysql error 1033 Incorrect information in file: 'xxx.frm'

Problem Description 1. Database of the collection...