Sometimes I am lucky. When I think that I have mastered a certain knowledge point, another problem occurs immediately, so that I can know that my previous cognition is incomplete.
As described in my previous blog post, if an auto-increment field
Use LIMIT 1 when only one row of data is required
When you query a table, you know that only one result is returned, but you may need to fetch the cursor or check the number of returned records.In this case, adding LIMIT 1 can increase performance.
Optimize Your query for query Cache
Query cache is enabled on most MySQL servers. This is one of the most effective ways to improve performance, and it is processed by the MySQL database engine. When many identical queries are executed multiple
1. Check whether the table space is shared or independent.Copy codeThe Code is as follows:Mysql> show variables like '% per_table % ';+ ----------------------- + ------- +| Variable_name | Value |+ ----------------------- + ------- +|
MySQL transaction ACID indicates that each transaction-type RDBMS must comply with four attributes, atomicity, consistency, isolation, and durability. Through the InnoDB and BDB types tables, MySQL transactions can fully meet the ACID test of
Recently, a Mysql SLAVE of the company experienced a delay of seconds. When we found the delay two days ago, we observed the slave status. Everything was normal and thought that the recent business adjustment caused too many write operations, the
MySQL Index classification: Two Storage types of indexes: B-tree index and HASH index. B-tree is the default index method. MySQL indexes include general indexes, unique indexes, full-text indexes, single-column indexes, multi-column indexes, and
In my. ini, the default Character Set of MySQL is latin1. We often use UTF-8 (utf8 in MySQL) and gbk to store Chinese characters.
Therefore, you can add the default charset setting statement at the end of the definition table in a table that needs
Mysql Chinese Garbled text is a common problem, and it is not difficult to solve it. This article will be guided by how to find and solve the problem when I encounter it, to present the ideas and processes for analyzing and solving the
Linux suse11 can log on to terminal to perform various operations normally. jdbc web program running on tomcat has an exception:
Com. mysql. jdbc. exceptions. jdbc4.CommunicationsException: Communications link failureThe last packet sent
After group by is used, the queried list is sorted by the default asc sequence of the primary key. order by can only be used for the grouped list because the priority of order by is lower than that of group, so how can we solve the grouping Sorting
On the mysql server, my. i'm not talking about the importance of cnf files. Let's take a look at my. the cnf file's parameter configuration for different machines is reasonable. I hope the article will help you.
PS: This configuration file is
Myisam and innodb are the most commonly used table storage engines in mysql. We almost don't need or use them any more advanced. For the features of myisam innodb, I 'd like to know a little about it, next I will introduce how to convert innodb
You can use the instr function to determine the position where the mysql search character appears in the field string. This is a bit like the instr function in asp. I hope this tutorial will be helpful to you.
Usage:
INSTR (ori_str, sub_str)
MySQL
In mysql, data in the complex tabulation can be implemented simply by using insert... select. Next I will give you an example of simple table data replication.
Syntax
Insert into db1_name (field1, field2) SELECT field1, field2 FROM db2_name
Instance
Most of us will use the mysqldump command to import and export data in mysql. Today I want to introduce other commands to import and export text file commands, hoping to help you.
MySQL writes data through common insert statements, such Insert into
What do you do when the article is top? It is nothing more than the smallest or largest sorting ID for asc or desc. Today I want to introduce the use of mysql sorting methods to quickly achieve sorting.
Today, when I was doing two development jobs,
In mysql applications, the problem of mysql Chinese garbled characters is not unexpected, but the encoding problem is caused by the server encoding or latin1 or both database encoding and program page encoding is not well handled, you only need to
An ERROR 1418 is reported when you create a function in MySQL. You cannot create a function. According to the official prompt, the failure to create a function may be a security configuration or the function is not enabled. Let's take a look at
The mysql GROUP command is group by. Next I will share my notes when studying the group by command. Here I will discuss the simple usage of GROUP BY and GROUP BY sorting.
The group statement group by is used whenever you want to know the number of
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.