MySQL has a number of storage engines, for different applications, you can choose the appropriate storage engine for each table, which helps improve MySQL performance.To create a news statement:
Copy Code code as follows:
CREATE TABLE
MySQL has a variety of storage engines, and MyISAM and InnoDB are two common types. Here are some basic concepts about the two engines (not an in-depth introduction).MyISAM is the default storage engine for MySQL, which supports Full-text search
Today in the forum, found a seemingly very simple problem, but it has aroused widespread concern:This is a very early interview question:A table, which has ID from the primary key, when the insert 17 records, delete the first 15,16,17 records, and
Install a MySQL on the virtual machine, modify its my.cof file, found that this configuration file is very powerful, but encountered a problem:
When you set up the character set, you set up the Default-character-set=utf8 under [client], [MySQL],
MySQL is so open that you can easily adjust its default settings to achieve better performance and stability. Some key variables that need to be optimized are as follows:
Change index buffer Length (key_buffer)
In general, the variable controls
In order to apply the scalability of the system, often need to scale out the database design, scale out design is to increase the database processing node to improve the overall processing capacity of the system, that is, increase the number of
An optimization of a complex associative SQL was processed yesterday, and this kind of SQL optimization often takes into account the following four points:
First, the result set returned by the query, usually the query returns few result sets, is
Some time ago, early in the morning, the alarm was received, warning PHP-FPM the number of processes exceeded the threshold. The final discovery was that a SQL was not used to the index, resulting in slow execution of the database query, which
Errors such as "Got a packet bigger than ' Max_allowed_packet ' or" MySQL server bytes has "occur when you import the database. This is typically because the currently imported data is larger than the maximum packet size of the system's limit. The
Phenomenon:
There is a table action_conf, the data is as follows:If you want to get a en_name record that starts with exp_site_10_, how do you write the SQL statement?
So easy!
Select En_name from action_conf where en_name like '
To display a database or table:
Copy Code code as follows:
Show databases;//can then use database_name;
Show tables;
Change table name:
Copy Code code as follows:
ALTER TABLE table_name rename new_t;
This paper illustrates the method of Php+mysql to realize the column without limit classification. Share to everyone for your reference, specific as follows:
A very simple and simple example of No limit classification, with indentation effect, just
Oracle has recently released several new features in the latest Mysql5.7.2 version, and this is the article. Most of the improvements are in database performance and replication related functions, this new version will bring us incredible results.
MySQL's date function. Current date in Example:Curdate () is June 24, 2013.Year (): Show yearsMysql> Select Year (Curdate ()); +-----------------+ | Year (Curdate ()) | +-----------------+ | 2013 | +-----------------+ 1 row in Set (0.01 sec)MONTH ():
For some systems with large data volume, the problem of database is not only inefficient, but also is the data storage time is long. Like a reporting system, it can take up to a few hours or more than 10 hours a day to spend on a data import.
Copy Code code as follows:
SELECT * FROM _test a LEFT join _test B on a.id=b.id where a.level= ' and a.month= ' and b.level= ' 03 ' ;
Select a.*,b.* from (SELECT * to _test where level= ' and month= ') as a LEFT join (SELECT * from _test
The if of MySQL can be used as an expression or in a stored procedure as a Process Control statement, as in the following is used as an expression:
An If expression
Copy Code code as follows:
IF (EXPR1,EXPR2,EXPR3)
If Expr1 is
MySQL pagination seems to have been a problem, what is the optimization method? Online to see some of the online recommended pagination method, but it does not seem feasible, can you comment on it?
Method 1: Directly use the SQL statements provided
Table A
Aid adate
1 A1
2 A2
3 A3
Table B
Bid bdate
1 B1
2 b2
4 b4
Two tables A, B connected, to remove the same ID field.
SELECT * from a INNER join B on a.aid = B.bid
This is the only matching data to be fetched.
At this point,
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