Label:There are 3 ways to fix MySQL database:1. mysql Native SQL command: RepairExecute the Repair TABLE SQL statementSyntax: REPAIR TABLE tablename[,tablename1 ...] [Options]Example: mysql> use database xxx;mysql> Repair Table *;2. Using MySQL's own client tool: Mysqlcheck (no need to stop
finished before the report is output. The combined Calculation function count () assigns the result of the arg2 of the "Dispatch_command" function to @query.# querycounts.d-p ' Pgrep-x mysqld 'Tracing ... Hit Ctrl-c to end.^cSELECT * FROM Countrylanguage LIMIT 5 1Show Tables 4SELECT * FROM City 10Obviously, the output of this example is not the result of a real production system. If used in production, you will get far more results than that output.The example discussed here is just the tip of
intercept the MySQL CPU value, Cut command By default is tab-delimited, but PS aux display the string blank is a space instead of tab, we will use a space to split, Some of the string is a number of spaces, here the-f8 parameter is to intercept the 8th string (some system may be 6th), this string is the CPU utilization of MySQL!Maybe you have a question, now that you've got the CPU usage of
When we use the MySQL database, we may encounter many unexpected damages to the database table, and the data is new data. We usually look for the backup data, but in general, it cannot be found. This chapter describes how to detect MySQL database table faults.
The general process of fault detection and correction in the table is as follows:
Check the tables with
The general process of fault detection and correction for a table is as follows:
Check for errors in the table. If the table checks through, complete the task, or you must fix the database table that is wrong.
Copy the table files before starting the repair to keep the data secure.
Start repairing database tables.
If the repair fails, restore the data from the backup or update log of the database.
Before you use Myisamchk or isamchk to check or fi
This article mainly introduces the PHP implementation of the MySQL master-slave database state detection function, combined with specific examples of PHP detection of multiple MySQL master-slave database connection status related implementation skills, the need for friends can refer to the next
This paper describes th
top and bottom two connections, it is very simple to detect. Mysql>selectcount (*) from (select*fromt1_oldunionselect *fromt1_new) ast;+----------+|count (*) |+----------+|100|+----------+1rowinset (0.06 NBSP;SEC) Here the number of records is 100, the preliminary proof that the two tables are consistent. However, there is a bug in this approach, and in some cases it is not possible to simply represent a consistent result set. such as:mysql>createtab
You may be in the process of using MySQL, all kinds of accidents cause damage to the database table, and this data is often the most recent data, it is often impossible to find in the backup data. This chapter describes how to detect the failure of a MySQL database table.
The general process of fault detection and correction for a table is as follows:
Check for
Paip. Improve Stability --- automatic detection of sleep mysql database dead connections and killAuthor Attilax airlong, EMAIL: 1466519819@qq.comSource: attilax ColumnAddress: http://blog.csdn.net/attilax///// Detects the leakage of the application database.The main principle is:A. When conn is called, get the localport of conn and store it as a listB. query all connections on the current machine from mysql
IP:"+IP) FD=Socket.socket (socket.af_inet, socket. SOCK_STREAM) Result= FD.CONNECT_EX ((IP, 1080))
ifresult = =0:Print("Success"+IP) SQL="UPDATE wx_proxy SET valid=2 WHERE ip=\ ""+ip+"\""execsql (SQL)Else:
Print("Error"+IP) SQL="UPDATE wx_proxy SET valid=-1 WHERE ip=\ ""+ IP +"\""execsql (SQL) fd.close ()defLoadip ():ifLen (IPList) >0:Print("checking....wait")
returnCursor.execute ("SELECT IP from wx_proxy WHERE valid!=-1 ORDER by ID DESC") Data=Cursor.fetchall () fo
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.