Linux Platforms
Monitor MySQL executed SQL statements for performance and functional testing in conjunction with development, to facilitate monitoring of executing SQL statements,
You can add the following in/etc/mysqld: Log =/usr/local/mysql/var21005/mysql.log can be used: tail-f Mysql.log to monitor www.xxx.com If you need to monitor slow queries you can add the following: Log-slow-queries =/usr/local/mysql/var21005/slowquery.loglong_query_time = 1
Windows platform
Modify My.ini, add a log line under Mysqld,
[Mysqld]
Log = "D:/tmp/mysql_log/mysql_log.sql"
Then, restarting MySQL, you can see in real time the statement that the MYQL server is currently executing.
Restart MySQL
The second method is ineffective for me, and I'll find out later!
First, MySQL service
My Computer-(right-click) management-Services and applications-service--mysql--on (stop, restart)
Second, the command line mode
Windows
1. Click "Start", "Run" (shortcut key Win+r).
2. Start: Enter net stop MySQL
3. Stop: Enter net start MySQL
Hint * Redhat Linux also supports service command, boot: # service mysqld start stop: # service mysqld Stop restart: # service mysqld Restart
* Windows can not be restarted directly (restart), can only stop, then start.
Third, Too many connections
2008-04-30┆379,578 views┆56,071
Error Number:1040
Problem Analysis:
The number of connections exceeds the MySQL setting value, which is related to Max_connections and wait_timeout. The larger the value of the wait_timeout, the longer the idle wait for the connection, which results in a greater number of current connections.
Workaround:
1, virtual host users please contact the space provider to optimize the configuration of MySQL server;
2, independent host users please contact the server administrator to optimize the configuration of MySQL server, can refer to:
Modify the parameters in the MySQL configuration file (under Windows My.ini, Linux for my.cnf):
- CODE: [COPY]
- max_connections= 1000
- W
Monitoring SQL statements executed by MySQL