MySQL Use intravenous drip

Source: Internet
Author: User
Tags character set ini versions phpmyadmin

There are some details to be found during the work, and there is an accumulation here. I am using MySQL 5, which is not necessarily applicable in other versions.

The same characters may occupy different space in different character sets

The default Latin1 character set, the Chinese character occupies two bytes, English occupies 1 bytes. In the gb2312 and Utf-8 and other character sets, English also accounts for two bytes. From the point of view of the character encoding seems to be justifiable, but this process in MySQL has not really noticed before, char (10) in the 10 is based on the number of characters in the set. It is especially necessary to be careful when dealing with large amounts of data, but it is also possible to weigh options between char and varchar.

tinyint and smallint Mediaint int

Whether you specify tinyint (1) or tinyint (2), the range of values saved in a tinyint field will be unsigned when 0-255 (Signed-127-128), and other int types have a similar situation.

phpMyAdmin display "Total" inaccurate

This should not be the reason for MySQL. When I select * from innodb_table, the total number displayed and the Select COUNT (*) from innodb_table may not be the same. This has been noted before, and has caused several misunderstandings before. Seemingly not only InnoDB table will have such a situation, MyISAM table in phpMyAdmin also have such a problem.

Memory table

The memory table has the size limit, the memory file exceeds the setting in My.ini, will automatically convert the part to the hard disk. Memory tables account for the amount of space allocated to a fixed size, even if only one record in a table may occupy a few m space. The memory table is limited in size, can be set in My.ini, when the memory size reaches the limit, may error: #1114: The table ' XXX ' is full. The above is what I actually encountered, but my.ini in the following paragraph:

# Maximum size for internal (in-memory) temporary tables. If a table

# grows larger than this value, it's automatically converted to disk

# based table This limitation was for a single table. There can be many

# of them.

tmp_table_size=13m

Merg table

Only MyISAM tables can be Merg, and all of the child table structures in the table structure require consistency.

Multiple table Updates

Comparing new versions supports simultaneous update of multiple tables. Like this, update user_state, user_state2 set user_state.state_0507_db2 = USER_STATE2.STATE_0507_DB2 where user_state.qq = user _state2.qq

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.