MySQL Character Set modification command
1. modify server level. temporary changes: mysql> set global character_set_server = utf8; B. permanent change: shell> VI/etc/My. CNF [mysqld] default-character-set = utf8
2. modify Database Level A.
Author: skateTime: 2013/04/09
MySQL Character Set Summary
Today, my colleague, brother a, found a MySQL test server with garbled characters. He has recorded character sets before. I will try again today.
Modify the character set and default
Brief Description
Character Set and verification rulesCharacter Set is a set of symbols and encoding. A collation is a set of rules used to compare characters in a character set.MySql provides strong support in collation, and mongoel does not find
Problem: the form application developed by VS2005, the database is MySql.net; Queries statements with Chinese characters, no results are returned, and no error is reported !!!
MySql character encoding problem !!!
Solution:
1. Use MySQLDriverCSAfter
MySQL Character Set and verification set
I. Character Set
1. MySQL's Character Set settings are flexible
You can set the default Character Set of the server;
Default Character Set of the database;
The default Character Set of the table;
Column
PHP MySQL character escaping problem
Background processing
$name =addslashes ($_post[' name ');//Escape single quotation mark
When insert, is it stored in the database with an escape symbol? Or remove the escape symbol?
If you're depositing the
1, first need to modify the MySQL database configuration file My.ini, this file is placed in the MySQL root directory. Look for the Default-character-set property under this file and change its value to UTF8 ( Note: Not utf-8, also note case ), You
Character-set-server/default-character-set: Server character set, by default.Character-set-database: Database character set.Character-set-table: Database table character Set.Priority increases in order. Therefore, in general, you only need to set
Brief Description
Character set and proofing rules
A character set is a set of symbols and encodings. A proofing rule is a set of rules used to compare characters within a character set.
MySQL in collation to provide strong support, oracel in this
Author:skatetime:2013/04/09MySQL Character set summaryToday colleague Jie brother found inside a MySQL test server garbled, previously also recorded about the character set, and today to addModifying the MySQL character set and default storage
1. View the default character set (by default, MySQL's character set is Latin1 (Iso_8859_1), and the settings for viewing the system's character set and ordering can be set through the following two commands:Mysql>SHOW VARIABLES like 'character%';+--
--Set the encoding of the database when creating the database--CHARACTER Set: Specifies the character set used by the database, UTF8 cannot be written utf-8--COLLATE: Specifies the collation of the database character set, and the default collation
InMySQLClient andMySQLThere is a character set converter between the service side. Character_set_client =>GBK: The converter knows that the client is sending a GBK format encoding character_set_connection=> GBK: Convert the data sent from the
The insertion of the Chinese characters on MySQL is wrong, see the following analysis.Incorrect string value: ' \xd0\xc2\xc8a\xbew ' for column ' Ctnr ' at row 1MySQL character set related parameters:Character_set_server: Server Character Set
first, what is a character set :To put it simply, a character set is a set of corresponding relationships;1, the current computer is built on the basis of binary system, binary is a numerical expression, that is, binary only expression "number",
The environment of this experiment:Linux systems:Cat/etc/redhat-releaseCentOS Release 6.5 (Final)Database environment:Select version ();+------------+| Version () |+------------+| 5.5.32-log |+------------+The process of simulating a database that
MySQL provides a number of functions for our development has a lot of help, below the MySQL provides some of the common functions of the collation, first, the character processing function:1.CONCAT ()Usage: string link function, link string field to
Through show variables like ' character_set%% '; view encodingThere are several ways to modify MySQL's encoding:1. Modify My.ini (under Windows) or/ETC/MY.CNF (under Linux) via configuration file
Add the following separately
650)
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.