After the previous SQL server, I would like to try MYSQL's intrusion test and share it with you.
In general, I have been using MYSQL, And I am familiar with MYSQL. In comparison, I feel that MYSQL is safer. This is just what I guess, I hope it will
This is generally the case when you start to learn SQL statements.
The Code is as follows: SELECT * FROM table order by id LIMIT 1000, 10;
However, when the data reaches the million level, writing will slow down.
The Code is as follows: SELECT *
When it comes to database data storage, it is often the only value problem. Some are restrictions imposed by primary keys, and some are business needs.
The following describes how to obtain or produce unique values:Create a test table tbl_user with
To query five non-duplicate data records in mysql, use the following:
Copy codeThe Code is as follows:SELECT * FROM 'table' order by rand () LIMIT 5
You can. However, the test results show that the efficiency is very low. It takes more than 8
1. Randomly query a piece of data
Method 1: SELECT * FROM 'table' order by rand () limit 1
Rating: it is not recommended and the efficiency is very low. It is described in the official document that Order By and RAND () can be used to scan the table
REGEXPExample 1. the query field contains non-English dataCopy codeThe Code is as follows:SELECT *FROM'm _ user'WHERE 'emp_no'REGEXP '[^-~] '= 1 Column 2. In this way, all non-English content can be obtained.Copy codeThe Code is as follows:SELECT
1. The table's primary key and foreign key must have an index;
2. Indexes should be available for tables with more than 300 of the data volume;
3. For tables that are often connected to other tables, indexes should be created on the connection
What is a trigger? A trigger is a database program that monitors a behavior of a data table. Once the behavior of a data table occurs, the corresponding SQL statement is executed immediately.Syntax structure of the trigger: Name of the create
MySQL databases are IO-intensive programs. Like other databases, their main functions are data persistence and data management. This article focuses on optimizing MySQL database cache parameters such as query cache, table cache, log cache, index
There are many Key-Value caches, most of which are memcache and redis. They all run in the form of independent services. At work, sometimes a local key-value cache needs to be embedded, of course there are already LevelDb and so on, but it still
The article "common methods of the query optimizer" lists some common optimization methods of the optimizer. The query optimizer also has some limitations while providing these features. These limitations are often improved with the upgrade of the
1, mysql-connector-java-5.0.4-bin.jar into C: \ Program Files \ Apache Software Foundation \ Tomcat 7.0 \ lib
2. The project's web. xml is consistent with tomcat
webt3 index.jsp Tomcat 7
Summarize the optimization methods of common query statements.1 COUNT
1. Functions of COUNT
· COUNT (table. filed) indicates the number of records for which this field is not null.
· COUNT (*) or COUNT (not nullable field) indicates the number of
First, let's look at a stored procedure, which is used to construct data. Of course, the stored procedure simplifies some unnecessary table structures.
CREATE PROCEDURE modifyRootEntry()BEGIN DECLARE done INT DEFAULT FALSE; DECLARE userId INT;
We often forget the mysql password and may need to modify it.
Record the test results of how Baidu modified the mysql password:1. Add a line after the configuration file mysql. ini:
Skip-grant-tablesIndicates skipping the authorization table.
VARCHAR2 (size) is a variable-length string. Its maximum length is size bytes. The maximum value of size is 4000, and the minimum value is 1. You must specify the size of a VARCHAR2.
NVARCHAR2 (size), a variable-length string. the maximum length of
The differences between stored functions and stored procedures are as follows:
1. IN the function parameter list, the mode can only be IN.
2. The function must return a value. Its type is defined in the function header.
3. functions can be called
Translated by: Tie
Time: December 25, 2013Original article address: Activating the Binary Log
Reference: building a robust data center with high-availability MySQL
To enable the binary log feature, you can use"
-- Log-bin [= name]"Option to start
The purpose of indexing is to greatly improve query efficiency and read/write efficiency.
Kettle inserts data into the SQL statement. indexes must be created during the update, which greatly improves the processing time.
However, when an index is
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