When installing MySQL, if the character encoding is the default value latin1, you need to modify it to UTF8 to support Chinese data.The command is as follows:1. Display the database character set
Mysql> Show create DATABASE test;+----------+
1. Specify the default character set when MySQL database is createdCREATE database $DN_NAME DEFAULT CHARACTER SET utf8mb4 -- UTF-8 Unicode COLLATE utf8mb4_general_ciAnnotations:> utf8mb4 -- UTF-8 Unicode:字符集;mb4是在utf8的基础上支持了imoji表情。>
Learning database, the most frustrating is the character set of the problem, once a problem, there will be the impulse to smash the computer, especially after modifying a lot of character sets are still unsuccessful!The database software I use is
On MySQL insert the kanji times error for example below. See the following analysis in detail.Incorrect string value: ' \xd0\xc2\xc8a\xbew ' for column ' Ctnr ' at row 1MySQL character set related parameters:Character_set_server: Server Character
Toolbar-"database-" Edit current DBMSThen, select: Mysql50::script\objects\table\optionsAdd at the end of the options:ENGINE =%s:list = BDB | HEAP | ISAM | InnoDB | MERGE | Mrg_myisam | MYISAM, default = MYISAMDEFAULT CHARACTER SET =%s:list = UTF8 |
Today, when querying database character fields in PHP, the syntax is exactly the same, but the query is not the result, and in the command line, the same statement can achieve the desired effect. After a lot of understanding, we found that the
Add #在 the [client] field[Client]Default-character-set=utf8#在 [mysqld] field to add[Mysqld]Character-set-server=utf8#在 the [MySQL] field to add[MySQL]Default-character-set=utf8#修改完成后重启mysql~$ sudo/etc/init.d/mysql Restart#查看效果Mysql> Show variables
Http://218.194.248.2/~wuxiaogang/cpcourse/database/mysql/charset.htm1. Modify the MySQL my.cnf# VI/ETC/MY.CNFAdd under [client]Default-character-set=utf8Add under [mysqld]Default-character-set=utf8If there is no my.cnf, find the location of the CNF
Can the MySQL default character set be modified? The answer is yes, the following will teach you two ways to modify the MySQL default character set, you want to learn the MySQL default character set can be enlightened.(1) The simplest method of
First, the character set summary In fact, most of the knowledge in this article has been very clear. Here is just a talk about their own sentiment. 1. Although UTF-8 begins with UTF (Unicode transfermation format), he is not Unicode in real sense.
The official document indicates that a row has a maximum of 65,535 bytes. Utf-8 character Test 1 build a Chinese character 3 bytes in Utf-8By calculating 65535/3, you can draw a maximum of 21845 per row, build a table650) this.width=650; "class="
Summarize: Utf8_unicode_ci and Utf8_general_ci have no real difference between Chinese and English.Utf8_general_ci proofreading speed is fast, but the accuracy is slightly worse.Utf8_unicode_ci accuracy is high, but the proofreading speed is
Modify MySQL character set in Liunx: 1. find the location of MySQL cnf file find-iname *. cnf-printusrsharemysqlmy-innodb-heavy-4G.cnfusrsharemysqlmy-large.cnfusrsharemysqlmy-small.cnfusrsharemysqlmy-medium.cnfusrsharemysqlmy-huge.cnf
Modify MySQL
1. Description of the problemin the Report development tool Finereport, the MySQL database connection through the data connection encoding conversion to encode the conversion, in the report input to the database input Chinese data, always appear
It is very basic to add or delete a primary key in mysql. The following describes how to add or delete a primary key in mysql. If you are a new user of mysql database, take a look. Modify the mysql Character Set: You can set the mysql character set
Modify the default MySQL Character Set Method, generally even if you set the default mysql Character Set of the table to utf8 and send the query by UTF-8 encoding, you will find that the stored in the database is still messy
Modify the default MySQL
There are a variety of MySQL character sets, the following is a list of three of the most common MySQL character set viewing methods, this method for your reference, I hope you learn MySQL database can be enlightened.One, view MySQL database server
========================================================== ====================================== Supplement 1: ========================================================== ======================================MySQL character encoding is introduced
Are you very worried about getting MySQL to change the character set? Don't worry. The following articles will give you a correct solution. The following articles mainly introduce the solution for changing the character set of MySQL. The following
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.