I used wampServer. when I used Java to record data in MySQL today, I tried Chinese garbled characters in my. the default-character-set and character_set_server statements are added to the] client] and [mysqld] of the INI file, but the wamp cannot be
Replace can replace characters in mysql, but if you really want to update the replace content, we also need to combine the update operation.
Replace can replace characters in mysql, but if you really want to update the replace content, we also need
In the production environment, the MySQL database character set needs to be upgraded for various reasons. For example, to support Chinese characters, you can upgrade from the latin1 character set to GBK.
In the production environment, the MySQL
By default, mysql is installed on Ubuntu with the character set latin1. 1. Support showcharacterset for viewing character sets; 2. Check the variables showvariableslike "character_set %" for character sets; 3. Set the default character set to solve
1. List all character sets supported by MYSQL:
Show character set;
2. Current MYSQL Server Character Set
Show variables like 'character _ set _ % ';
3. Current MYSQL Server character set verification settings
Show variables like 'collation _ %
Setting character encoding in Mysql can solve some common problems. For example, if an error occurs when using different character sets, the following describes how to set character encoding in Mysql to solve this problem.
The error is that there
Regardless of the version of the mysql client that the client uses to connect to the server, it is found that character_set_client, character_set_connection, character_set_results will always be consistent with the server after the
Want to set up the site to UTF8, check a lot of information, the truth also understand, the page, program, database character encoding unified together. The truth is clear, do not know how to do.
Web server space rented by someone else, MySQL
/Etc/init. d/mysql start (stop) is used to start and stop the server./Etc/mysql/main configuration file location my. cnf/Var/lib/mysql/stores the database table folder. Here, mysql is equivalent to the date folder of mysql in windows.
After mysql is
In a string, some sequences have special meanings. These sequences start with a backslash ('\').Escape characters. MySQL recognizes the following escape sequence:
\ 0
ASCII 0 (NUL) characters.
\'
Single quotes (''').
Personal suggestion: use the database character set whenever possibleUtf8(UTF-8), so that your data can be smoothly migrated, because the utf8 character set is currently the most suitable character set for conversion between different character sets,
In
MySQL Client and
MySQL There is a character set converter between servers.
Character_set_client => GBK: the converter knows that the client sends the GBK encoding character_set_connection => GBK: converts the data sent from the client to the
Http://blog.donews.com/yllr/archive/2007/01/03/1107388.aspx
MySQL and later versions support multiple character sets, but the default Character Set installation isLatin1 is a Swedish text, so many people want to install discuz and other forums
By default, mysql is installed on Ubuntu with the character set latin1.
1. View character set support
Show character set;
2. View character set variables
Show variables like "character_set % ";
3. Set the default Character Set
To solve garbled
Use case
First, let's look at an example:
There is a user table
User (username VARCHAR (5) character set utf8COLLATE utf8_general_ci );
Record ('username'); and ('username ');
Select * from User where username = 'username'; two data items are
MySQL (Versions later than 4.1) servers use character sets in six key locations: client, connection, database, results, server, and system. MySQL has two character set concepts: character set itself and character set verification rules. Character
1. character_set_server and collation_server
These two variables are the server's character set. When the system is started, you can use -- character-set-server and -- collation-server to set them. If not, the system sets the two variables to the
CopyCode The Code is as follows: Update dede_addonsoft set dxylink = Replace (dxylink, '.zip ', '.rar') where aid> 45553;
Copy codeThe Code is as follows: Update 'table _ name' set field = replace(field,'.rar','.7z ');
Table_name: name of the
Author/Translator: ye Jinrong (Email:), Source: http://imysql.cnFor reprinting, please indicate the author/translator and the source, and cannot be used for commercial purposes. violators must investigate.
译者:叶金荣(Email:),来源:MySQL手册版本
UPDATE Table name SET Specifies field = replace (specify field, ' String to replace ', ' desired string ') WHERE condition; Delete space used today
Example one:
The code is as follows
Copy Code
UPDATE ' Qlj_joke ' SET
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.