When the website runs slowly, I know why it is so slow. So I checked and checked that the database is definitely a very important part, and the SQL statements running in it cannot be ignored. When I work on projects, I also pay attention to the
1. uptime can be used to view the system running time
Show global status like 'uptime ';
2. Use linux commands to view
There is an uptime in Linux to view the running time of the system, but MySQL does not have this command.
However, the ps
Although this situation should not happen, we should have designed it in advance and won't be able to change it in the future, but due to the negligence of our previous work, to be honest, it is not only my personal negligence, but also the
You can use show and updtime or directly use grep MySQL-related parameters in linux to check the mysql startup time and duration. Let's take a look.
1. uptime can be used to view the system running time
Show global status like 'uptime ';
2. Use
This article introduces the learning notes for redis sorted sets. For more information, see.
Sorted set is an upgraded version of set. It adds an ordered Attribute Based on set.
You can specify an element when modifying it. After each element is
In SQL, order by has N Different usage methods. Yesterday I talked about an order by with an equal sign. Here we will introduce how order by sorts multiple fields at the same time.
Two fields can be added after order by, which are separated BY
In mysql, we used lock and unlock to lock tables and unlock tables. Today, I am going to give my friends some experience in using lock tables and unlock tables.
Usage of php mysql lock tables
Mysql table lock tables feels like a closed space.
When
REGEXP is a function used to execute Regular Expressions in mysql, such as the preg function in php. If regexp is just a simple query, use like, however, you still need to use regexp. Let's take a look.
MySql user manual suggestionsWhen constructing
MYSQL startup reports a 1067 error. In the system log "service mysql unexpectedly stopped", the Mysql Log is: "Plugin \ 'federated \ 'is disabled"
The error details are as follows:
121012 11:35:03 [Note] Plugin 'federated 'is disabled.121012 11:35:
This article introduces how to solve the problem of HAVING without group by in MySQL. If you don't want to use group by directly, you can refer to this article.
Today, a student gave me a response. There is a table whose id is the primary key. In
It is very easy to CREATE and delete indexes in mysql. If you CREATE an INDEX, you can directly use alter table or drop index to delete or modify the INDEX. Let's take a look at common statements.
Create and delete Indexes
You can CREATE an INDEX in
This article focuses on the security configuration of Memcache to prevent unauthorized data reading. If you encounter such problems, you can refer to it.
The memcache server directly performs operations after being connected through the client
Paging in mysql will provide us with the limit command for direct paging. If several pieces of data are directly paginated using the limit command, there is no problem, but if tens of thousands or millions of data, you will find that the machine
I found a strange problem today. After I re-installed mysql, I found that I had to connect to mysql again. The error 1045 is reported and I cannot connect to the mysql database normally. Let's take a look at the solution to this problem.
Mysql
In the mysql database, the three functions CONCAT () CONCAT_WS () GROUP_CONCAT () are connection strings, but there are also some differences between them. Let's talk about CONCAT (). Use CONCAT () if one character is null, all successful
Mysql self-join queries some data first Based on the condition and then returns the returned value to query some data. This is mysql self-join. Of course, left join can also be used, next let's take a look at the usage of mysql self-connection.
The
IN the past, it was very difficult to find out how to sort the values found in. Later, gg and bb found that mysql IN sorting is very simple. Next I will sort out the relevant instances for your reference.
Assume that a table is as follows:
Insert into is used to insert records in mysql. However, to insert multiple records, insert into or other methods are used to traverse and execute insert into. Let's take a look.
Normally, we use SQL to execute
Insert into 'tabale '('name') VALUE (
This article analyzes and introduces the cause and solution of the "Can't create/write to file xxx (Errcode: 13)" error prompt in MySQL.
Recently, I encountered a problem where MySQL could not create temporary files. I learned some knowledge about
Next I will take a look at the mysql optimization show status to view the MySQL server status information. here we can use show status to view the current running status of the server to optimize the relevant configuration.
During website
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.