Show Processlist Results Filter

Source: Internet
Author: User

   in MySQL  show variables where variable_name like '%auto% ' this statement can execute normally, but  show processlist where Host like '%192% ' will error:  error Code:1064you has an error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-use-near ' where host like '%10% ' at Line 1 show Processlist directly can be executed, but can not be screened, really make people headache, the same structure variables can, but why processlist is not? The reason for this is that MySQL has this BUG:Description:SHOW processlist lists to many lines if you have or even the users connect to Yousyste M. how to repeat:n.a. suggested Fix:it would is nice have something like show processlist like ' user|host | ... '  to reduce the output to the relevant Informations. much more nice would is having something Like: selec T user, host, time, command, time  from [mysql|information_schema].processlist where user = ' me ' and ' T null;  so processlist show way is not using filter lookup, may originate from the internal security mechanism of MySQL bar, show is used to view the internal MySQL running data, in fact processlistis a table in the  information_schema database, the way to look up the table is sure to be possible: SELECT user, host, time, command, time  from [mysql| Information_schema].processlist where user = ' me ' and state are not NULL, and a few details of the MySQL show command are available for review:  show tables or Show tables from database_name or show database_name.tables; Explanation: Displays the names of all tables in the current database show databases; Explanation: Displays the names of all databases in MySQL  show processlist; Explanation: Displays all the processes that are running in the system, that is, the query that is currently executing. Most users can view their own processes, but if they have process permissions, they can see all processes, including passwords.  show table status; Explanation: Displays information about each table in the database that is currently being used or specified. The information includes the table type and the last updated time of the table    show columns from table_name from database_name; or show columns from Database_name.table_name, or show fields; Explanation: Displays the column names in the table (and the effect of the DESC table_name command is the same)  show grants for [ email protected]; Explanation: Displays a user's permission to display a result similar to the Grant Command  show index from TABLE_NAME; or show keys; Explanation: Displays the index of the table  show status; Explanation: Displays information about some system-specific resources, such as the number of threads running  show variables; Explanation: Display the name and value of the system variable  show privileges; Explanation: Show different permissions supported by the server  show CREATE DATABASE database_name; Explanation: Displays the SQL statement that created the specified databases  show the creation TaBLE table_name; Explanation: Displays the SQL statement that created the specified data table  show engies; Explanation: Displays the storage engine and the default engine that are available after installation.  show InnoDB status; Explanation: Displays the status of the InnoDB storage engine  show logs; Explanation: Displays the BDB storage engine's log  show warnings; Explanation: Displays the error generated by the last statement executed , warning, and notification  show errors; Explanation: Only the error generated by the last execution statement   Most of the commands above can be used like, such as show table '%abce% '  .   Attached:  show status result Description   columnmeaningNameTable nameTypetype of table (Isam,myisam or heap)Row_formatrow storage format (fixed, dynamic, or compressed)RowsNumber of rowsAvg_row_lengthaverage length of the PresidentData_lengthlength of the data fileMax_data_lengthmaximum length of the data fileIndex_lengthlength of index fileData_freethe number of bytes allocated but not usedAuto_incrementNext AutoIncrement (auto plus 1) valueCreate_timetime the table was createdUpdate_timedate when the data file was last updatedCheck_timeThe last time to run a check on the tableCreate_optionsadditional options for use with CREATE TABLECommentwhen creating a table, use a comment (or why MySQL cannot access some information about the table information). Show index result Description: columnmeaningTableTable nameNon_unique0 If the index cannot contain duplicates. Key_nameIndex nameSeq_in_indexthe column order number in the index, starting at 1. column_nameThe column name. CollationHow the column is sorted in the index. In MySQL, this can have a value of a (ascending) or null (not sorted). Cardinalitythe number of unique values in the index. This can be changed by running Isamchk-a.Sub_partIf the column is only partially indexed, the number of index characters. NULL if the entire key is indexed. Show variables result Description: aborted_clientsthe number of connections that have been discarded because the client did not properly close the connection is dead. Aborted_connectsThe number of times the connection to the MySQL server has failed. Connectionsthe number of attempts to connect to the MySQL server. Created_tmp_tablesThe number of suppressed temporary tables that have been created when the statement is executed. Delayed_insert_threadsThe number of deferred plug-in processor threads being used. Delayed_writesthe number of rows written with the insert delayed. Delayed_errorsThe number of rows written with insert delayed for some errors (possibly repeating key values). Flush_commandsthe number of times the flush command was executed. Handler_deletethe number of times a request was requested to delete rows from a table. Handler_read_firstthe number of times the request was read into the first row in the table. Handler_read_keyThe request number is based on the key read line. Handler_read_nextthe number of times the request reads into a row based on one key. Handler_read_rndthe number of times a request is read into a row based on a fixed location. Handler_updatethe number of times a row in the table was requested to be updated. Handler_writethe number of times the request was inserted into the table. Key_blocks_usedthe number of blocks used for the keyword cache. Key_read_requeststhe number of times a key value was requested to be read from the cache. Key_readsthe number of times a key value has been physically read from disk. Key_write_requeststhe number of times a keyword block was requested to write to the cache. Key_writesThe number of times a key-value block was physically written to disk. Max_used_connectionsThe maximum number of connections that are used at the same time. Not_flushed_key_blocksA key block that has been changed in the key cache but has not been emptied to disk. Not_flushed_delayed_rowsThe number of rows waiting to be written in the Insert delay queue. Open_tablesthe number of open tables. Open_filesthe number of open files. Open_streamsNumber of open streams (primarily for log records)Opened_tablesThe number of tables that have been opened. QuestionsThe number of queries destined for the server. Slow_queriesthe number of queries that will take more than long_query_time time. threads_connectedThe number of connections currently open. Threads_runningthe number of threads not sleeping. UptimeHow many seconds the server has worked. Some of the comments above: if the opened_tables is too large, then your table_cache variable may be too small. If the key_reads is too big, then your key_cache may be too small. Cache hit ratios can be calculated using Key_reads/key_read_requests. If the handler_read_rnd is too large, then you are likely to have a large number of queries that require MySQL to scan the entire table or you have a junction (join) that does not correctly use the key value.

Show Processlist Results Filter

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.