Audit MySQL query slow.1. Start slow log.Two method:(1) edit my. CNF, add text as belows to [mysqld].# If long_query_time = 0, all queries will be saved to log fileLong_query_time = 1# Create the log file and give the log file MySQL access authority
MySQLSource codeMainly includes clientsProgramCode, Server-side code, test tool and some libraries. Below we will introduce some important directories.
Build
This directory is in the first part of this series.ArticleWe have
Recently, I found that the connection to the database in the new column is very slow. I log on to the MySQL database.
Mysql> show processlist;
| 20681949 | unauthenticated user | 10.10.4.193: 52497 | null | connect | reading from net | null || 20
First, go to the MySQL Command Line
1. Add User Permissions-indicates that a user with both the user name and password is added to sa can log on to the LAN and have all simple permissions for MySQL except grant option.
Grant all on *. * To 'sa '@ '
Method 1: use the set syntax to specify the parameter. If "Global" is not added, the parameter is only valid for this session.
Set [Global] character_set_client = utf8;Set [Global] character_set_connection = utf8;Set [Global]
CHECK TABLE tbl_name[,tbl_name] ... [option] ...
option= {QUICK | FAST | MEDIUM | EXTENDED | CHANGED}Check whether one or more tables have errors. Check table is useful for MyISAM and InnoDB tables. For MyISAM tables, keyword statistics are updated.
1). Description of configuration statements (basic knowledge ):# Server ID. the ID of each server cannot be set to the same number.Server-id = 1
# Enable slave database logs for chained ReplicationLog-slave-updates
# Whether the slave database is
To check whether the event scheduler is currently enabledShow variables like 'event _ schedount ';
Enable event height GeneratorSet global event_scheduler = 1;
Create eventSyntax:Create event [if not exists] event_nameOn schedule[On completion [not]
Query stored procedures in a database
Method 1:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Select 'name' from mysql. Proc where DB = 'your _ db_name 'and 'type' = 'Procedure'
Some time ago, I used Z-Blog to create a Blog about this young peak. I am bored and want to play with WordPress, so I built a PHP + MySQL platform on the xp OS on the local machine and tried WordPress. In fact, Baidu can find a lot of methods for
1. Create a database
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Create database 'db _ message ';
2. Create a data tableCode
Code highlighting produced by Actipro CodeHighlighter (freeware)http:
Avoid NULL values as much as possible
It is difficult for MySql to optimize empty columns and can be replaced by 0, special value or null string.
Limitations of B-TREE Indexing
You can only start from the leftmost column of the index. You cannot
13.7. SQL syntax used for preprocessing statements
MySQL 5.1 supports premade statements on the server side. If you use a suitable client programming interface, this support can take advantage of the efficient client/server binary Protocol
Use show status to optimize the MySQL databaseKeyword: mysql1. view the configuration information of the MySQL server.1. mysql> show variables;2. view various status values of the MySQL server.1. mysql> show global status;3. Slow Query1. mysql> show
Document directory
Related Resources:
Download Code:
Compile the Code:
Installation and running:
Debugging:
For a long time, start from Mysqld source code analysis. As I continue reading, I will write some articles to record my own
Extended Apache module development most of the tutorials on the Internet are centered on the Perl language memory. The "Writing Apache Modules with Perl and C" by foreigners can be regarded as a classic, but it has always been developed for older
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