If you are not interested in long speeches, you can also see the results directly, perhaps you are interested in the results. In practical applications, storage, optimization can be done in more than 90 million of the query response speed control in
One, MySQL affairs
Only InnoDB types of data tables in MySQL can support transaction processing.
There are two ways to start a transaction
(1) using Begin,rollback,commit to realize
Copy Code code as follows:
Begin a
The database is recorded in the table table by inserts, updates, and deletes, where
INSERT statement Implementation inserts data
UPDATE statement implementation updates data
DELETE statement implementation deletes dataReference table
Insert
Show STATUS
Login directly under the command line MySQL run show STATUS; query statements, detailed below
The same statement and show Variables;,show status is to look at the MySQL operation, and the above kind of information through the PMA look
UTF8 Character Set:
Sql>create table test (id int auto_increment,name varchar (), primary key (ID));
Sql>insert into test values (null, ' 1234567890 ');
Query OK, 1 row Affected (0.00 sec) Sql>insert into test values (null, ' 1,234,567,890 ');
Objective
The default replication is asynchronous (asynchronous) mode prior to MySQL version 5.5, and MySQL 5.5 provides the semisynchronous Replication pattern in plugins mode. Before introducing semi sync, let's take a look at the
Reset MySQL Self-add auto_increment initial valueNote that existing data is deleted by using any of the following methods.
Method One:
Delete from tb1;
ALTER TABLE tbl auto_increment = 100;
(Benefits, you can set auto_increment to start with any
Sometimes you run show processlist in MySQL, and you'll see that there are many of these processes in the database:
The reason for sleep is three, and the following is an explanation from the MySQL manual:
1. The client program did not invoke
The project needs to reinstall a MySQL server on the existing server, it is very difficult, because it was in my notebook before the test, its system is Ubuntu, what path Ah, start the way ah. It's not the same, so this time it still makes me tangle:
The sequence is a set of integer 1,2,3 ... The order in which the builds are generated. Sequences are frequently used in databases, because many applications require that each row in a table contains a unique value and sequence that provides an easy
A database index is a data structure that increases the speed of an operation, in which one or more columns can be used, providing a basis for two quick random lookups and efficient sequential access records to create the index.
When you create an
A transaction is a continuous set of database operations, as if it were a single unit of work. In other words, it will never be a complete transaction unless each individual operation within that group is successful. If any operation in the
To delete a database using mysqladmin:
Special permissions are required to create or delete a MySQL database. Therefore, suppose that you can use the MySQL mysqladmin binary to create any database as root user access.
Be careful to delete any
To create a database using mysqladmin:
Special permissions are required to create or delete a MySQL database. Therefore, suppose that with root user access, you can create any database using the MySQL mysqladmin binary.Example:
Here is a simple
Copy Code code as follows:
Adddate (Date,interval expr unit), Adddate (expr,days)
When the interval form of the second parameter is called, the Adddate () is a synonym for the date_add (). Related functions subdate () is synonymous with
You can use the group by group value one column, and if you want, you can calculate the column. A grouping column that uses features such as COUNT,SUM,AVG.
The table that you want to know about the employee_tbl of the GROUP BY clause has the
Usually, we will use the order by LIMIT start, offset to do the paging query. For example, the following SQL:
SELECT * from ' T1 ' WHERE ftype=1 the ORDER by ID DESC LIMIT 100, 10;
Or, like the following paged SQL without any
Now do the project need PHP to connect MySQL database, although learned before, but now basically forget, and then by looking for relevant information to find a solution, the following small series of specific methods to share in the cloud Habitat
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 '
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