MySQL InnoDB supports three kinds of line locking methods:Row lock (Record Lock): The lock is added directly above the index record.Gap Lock: Locks are added to a nonexistent free space, which can be between two index records or the space after the
ObjectiveAfter the completion of the table, it is obvious that the query for the data becomes more complex, especially in relation to the table, and in some cases it is not possible to use join at all.In fact, the individual is more encouraged to
Basic commandsDESC table name; query table structureShow columns from table name; query table resultsHaving the use, either out of the lookup field (select) or within the aggregation function (sum (); count ();.Limet 2,2: The result of the lookup is
Triggers in MySQLTrigger
Requirements: There are two tables, an order form, a commodity table. Each order is generated, the inventory of goods is reduced accordingly.
Trigger (Trigger)
Binding a piece of code in advance for a
MySQL Connection- - penter Password: ******The mysql> Command Prompt window will appear after successful login to The MySQL monitor....mysql >Create a database after logging inCREATE DATABASE IF not EXISTS DatabaseName;Deleting a databaseDROP
The InnoDB engine provides transactional security with commit, rollback, and crash resiliency, but the contrast MyISAM engine is less efficient and consumes more disk space and preserves data and indexes1. Auto-Grow columnThe auto-grow column of the
View current MySQL storage engine: Show engines \g or show variables like ' have% '; Both of these methods see which storage engines are supported by the current database, where disavled records indicate support for the storage engine, but are
Environment:10.0.0.51/172.16.1.51 mysql01 main Repository CentOS 7.210.0.0.52/172.16.1.52 mysql02 relay from the library CentOS 7.210.0.0.53/172.16.1.53 mysql03 from the library CentOS 7.2MYSQL01 configuration:[Mysqld]Bind-address =
MySQL master-slave synchronization:1. Why the master-slave synchronization?In Web application system, database performance is one of the main causes of system performance bottleneck. Especially in large-scale systems, database clustering has become
Isolation level of the transaction: READ UNCOMMITTED (UNCOMMITTED)At this level, the changes in the transaction, even if not committed, are visible to other transactions, and the transaction can read uncommitted data. Read COMMITTED (submit
What is MDLMdl,meta data lock, a metadata lock, is generally called a dictionary lock. The dictionary lock corresponds to a data lock. Dictionary lock is to protect the data object is changed, usually some DDL will change the Dictionary object, such
Online DDL consists of 3 stages, prepare phase, DDL execution phase, commit phase, rebuild mode is more than No-rebuild mode in a DDL execution phase, prepare phase and commit phase are similar. The following is a main introduction to the three
MySQL declaration variables and stored procedure analysis, mysql Stored Procedure
Declare Variables
Set global variables
Set @ a = 'new variable ';
Declear variables used in functions and stored procedures
Declear a int unsigned default 1;
This type
Analysis of mysql union and union all, analysis of mysqlunionall
In the database, the UNION and union all keywords combine the two results into one, but both have different usage and efficiency.
UNION in MySQL
UNION filters out duplicate records
Code example of the Order By multi-field sorting rule in MySQL, mysqlorder
Mentioned above
A whimsy, want to know what rules mysql order by sorting is based on? Okay. If you don't have much to say, go to the topic.
MySql order by single Field
Create
MySQL removes spaces from a field in batches. mysql fields contain spaces.
Is there any way for Mysql to remove spaces in characters in a field in batches? It is not only a space before and after the string, but also a space in the middle of the
Details about how to clear table space fragments in MySQL.
How to clear table space fragments in MySQL
Causes of fragmentation
(1) the storage of a table is fragmented. When a row of content is deleted, the space in the row is blank and left blank.
Mysql master-slave synchronization configuration and mysql master-slave Synchronization
1. Install mysql on two Ubuntu machines1. Check whether mysql is installed in the system.
This is already installed
Run the preceding command if no
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