How experts check and tune mysql performance (1/6)_PHP tutorial

WBOY
Release: 2016-07-13 17:05:42
Original
873 people have browsed it

I have been using the mysql tutorial database tutorial software. It works relatively stably and is very efficient. When encountering serious performance problems, there are generally several possibilities:

1. The index is not built;
2. The SQL writing method is too complicated;
3. Configuration error;
4. The machine really cannot bear the load;

1. The index is not established

If you see that mysql consumes a lot of CPU, you can use the mysql client tool to check it.

Execute under linux

/usr/local/mysql/bin/mysql -hlocalhost -uroot -p

Enter the password. If there is no password, you can enter the client interface without the -p parameter.

Look at the current operation

show full processlist

You can run it several times

This command can see the sql statement currently being executed. It will inform the executed sql, database name, execution status, client IP, account used, running time and other information

In my cache backend, most of the time there is no SQL statement displayed. I think this is normal. If you see a lot of sql statements, then this mysql must have performance problems 1 2 3 4 5 6

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630769.htmlTechArticleI have been using the mysql tutorial database tutorial software. It works relatively stably and is very efficient. When encountering serious performance problems, there are generally several possibilities: 1. The index is not...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template