MySQL slow Query
The slow query (slow log) helps us locate specific SQL statements for SQL statement optimization. For example, the slow query log records the SQL statements whose execution time exceeds the given value, locate the problem.
Enable
Turn on caching, set cache size, and implement the following:
1, modify the configuration file, Windows under the My.ini,linux is my.cnf;
On the last append to the configuration file:
The code is as follows
Copy Code
This article transferred from: HTTPS://WWW.TUICOOL.COM/WX/2EMBFMQObjectiveTalking about MySQL query optimization, I believe you have a collection of artifice: You cannot use SELECT *, do not use null fields, reasonably create an index, select the
What I wrote today is to use Java to implement MySQL backup and recovery. The backup load method is recovery.
Import java. io. File;Import java. io. IOException;Import java. io. InputStream;Import java. util. Properties;Public class JavaMysql {/****
MySQL slow Query
Slow query (slow log)It can help us locate specific SQL statements for SQL statement optimization. For example, slow query logs record the SQL statements whose execution time exceeds the given value, so as to locate the
1. Export the entire database
Mysqldump-u user name-p--default-character-set=latin1 Database name > exported file name (database default encoding is latin1)
Mysqldump-u wcnc-p SMGP_APPS_WCNC > Wcnc.sql
2. Export a table
Mysqldump-u user name-P
21 minute MySQL Getting Started tutorial
Directory
Introduction to the relevant concepts of MySQL
Second, the configuration of MySQL under Windows
Configuration steps
Start, stop, and uninstall of MySQL services
Install mysql & nbsp; install the MySQL source package in linux & nbsp; VMware6.5.2 + redhatEnterprise5AS & nbsp; & nbsp; the purpose of this experiment is to install the source code package for the purpose of simple implementation of its functions.
1. The configuration is enabled.Linux: In the mysql configuration file my. add log-slow-queries =/var/lib/mysql/slowquery in cnf. log (specify the location where the log file is stored, which can be null, the system will give a default file
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.