The concept of a character set everyone knows, proofing rules many people do not understand, the general database development is also not used in this concept, MySQL in this convenient seemingly very advanced, about aboutBrief descriptionCharacter
One, Character set1.mysql character set is very flexibleYou can set the server default character set;Database default character set;Table default character set;column character set;If a level does not specify a character set, the previous level is
Recently, in the project group used by the MySQL database, the insertion of data garbled, on this issue to make a summary, we start from the most basic point, to the root causes of errors and solutions.Basic concepts character (Character) refers to
Problem description: After getting code, you cannot request the micro-trust API data with Ajax. This is related to Ajax Cross-domain access to the user information to save to MySQL, found that the Chinese all become?? Garbled
By accessing the
Basic Concepts
• character (Character) refers to the smallest form of semantic notation in human language. such as ' A ', ' B ', etc.;
• Given a series of characters, assign a numeric value to each character, and use a numeric value to represent
When using the phpMyAdmin operation database on the virtual host space, if you see that the MySQL character set shown on the phpMyAdmin home page is cp1252 West European (latin1), when we import the data there will be garbled, the solution is:On the
The content of this article:
What is a character set? What is a proofing set?
Viewing character sets and proofing sets
Set up character sets and proofing sets
Problems with Chinese data in MySQL
Starting Date: 2018-04-19
How to modify the MySQL default character set: MySQL default encoding is Latin1, does not support Chinese, should be set to UTF8 to see if their database encoding is set.(0)1. If the MySQL installation directory, there is a suffix named:. ini
The customer provides the MySQL environment, but does not support Chinese,Use the following command to view the MySQL character setConnect to the MySQL service and enter the following commandMysql> Show variables like ' character_set% ';Shown below:+
The 1.MYSQL character set includes two concepts: the character set (CHARACTER) and the checksum rule (COLLATION). A character set is used to define how MySQL stores strings, and a validation rule is used to define how MySQL compares strings. A
Use the following command to view the MySQL character setConnect to the MySQL service and enter the following commandMysql>show variables like ' character_set% ';Shown below:[Plain] View plaincopy+--------------------------+--------------------------
(1) The simplest modification method is to modify mysql's my. INI file character set key value, such as default-character-setutf8character_set_serverutf8 after modification, restart mysql service, servicemysqlrestart using
MySQL character set: methods that do not contain garbled characters there are many types of character sets in the database. The main impact on programming is the client character set and database character set (there is also a server character set,
Deployment of Ubuntu12.0.4Linux server: modifying MySQL character set 5.x Ubuntu
Go to the mysql installation directory and find the configuration file,/etc/mysql/my. cnf
Run the following command:
sudo vi my.cnf
Go to the modify configuration
The following is a summary of MySQL character set operation commands that are run in mysql 5.5 command line:
View the character sets supported by MySQL:Show charset;View character set:StatusThe following is more specific:Show variables like
Character Set settings in Mysql are classified into the following levels: 1. mysql Server-level Character Set 2. database-level Character Set 3. character Set at the data table level 4. each character set at the data column level corresponds to a
MySQL character encoding problem, IncorrectstringvalueAn error is reported when inserting Chinese Characters in MySQL. For details, refer to the analysis below.Incorrect string value: '\ xD0 \ xC2 \ xC8A \ xbew' for column 'ctnr' at row 1MySQL
Use SQL statements to operate MYSQL character encoding-- View All character codes
Show character set;
-- View the commands for creating a database and the encoding used by the databaseShow create database dbtest;
-- View the database encoding:
Show
The concept of character set is clear to everyone. Many people do not understand the proofreading rules. This concept is not used in general database development. mysql seems very advanced in convenience.
The concept of character set is clear to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.