7.20
|
Name | Name of the table |
Type | Type of table (NISAM, MyISAM or HEAP) |
Rows | Number of rows |
Avg_row_length | Average row length |
Data_length | Length of the data file |
Max_data_length | Max length of the data file |
Index_length | Length of the index file |
Data_free | Number of allocated but not used bytes |
Auto_increment | Next autoincrement value |
Create_time | When the table was created |
Update_time | When the data file was last updated |
Check_time | When one last run a check on the table |
Create_options | Extra options used with CREATE TABLE
|
Comment | The comment used when creating the table (or some information why MySQL couldn't access the table information). |
SHOW FIELDS
est un synonyme de SHOW COLUMNS
et SHOW KEYS
est un synonyme de SHOW INDEX
Ces commandes sont disponibles avec l'utilitaire mysqlshow Nom_bdd Nom_table
ou mysqlshow -k Nom_bdd Nom_table
.
SHOW INDEX
retourne les informations dans un format proche de SQLStatistics
sous ODBC. Les informations suivantes sont disponibles :
Table | Name of the table |
Non_unique | 0 if the index can't contain duplicates. |
Key_name | Name of the index |
Seq_in_index | Column sequence number in index, starting with 1. |
Column_name | Column name. |
Collation | How the column is sorted in the index. In MySQL, this can have values A (Ascending) or NULL (Not sorted).
|
Cardinality | Number of unique values in the index. This is updated by running isamchk -a .
|
Sub_part | Number of indexed characters if the column is only partly indexed. NULL if the entire key is indexed.
|
SHOW STATUS fournit des informations sur le serveur (tout comme mysqladmin extended-status
). Les informations fournies sont présentées ci-dessous. Le format et les nombres peuvent varier :
+--------------------------+--------+ | Variable_name | Value | +--------------------------+--------+ | Aborted_clients | 0 | | Aborted_connects | 0 | | Created_tmp_tables | 0 | | Delayed_insert_threads | 0 | | Delayed_writes | 0 | | Delayed_errors | 0 | | Flush_commands | 2 | | Handler_delete | 2 | | Handler_read_first | 0 | | Handler_read_key | 1 | | Handler_read_next | 0 | | Handler_read_rnd | 35 | | Handler_update | 0 | | Handler_write | 2 | | Key_blocks_used | 0 | | Key_read_requests | 0 | | Key_reads | 0 | | Key_write_requests | 0 | | Key_writes | 0 | | Max_used_connections | 1 | | Not_flushed_key_blocks | 0 | | Not_flushed_delayed_rows | 0 | | Open_tables | 1 | | Open_files | 2 | | Open_streams | 0 | | Opened_tables | 11 | | Questions | 14 | | Running_threads | 1 | | Slow_requêtes | 0 | | Uptime | 149111 | +--------------------------+--------+
Les variables ci-dessus ont les significations suivantes :
Aborted_clients | Number of connections that has been aborted because the client has died without closing the connection properly. |
Aborted_connects | Number of tries to connect to the MySQL server that has failed. |
Created_tmp_tables | Number of implicit temporary tables that has been created while executing statements. |
Delayed_insert_threads | Number of delayed insert handler threads in use. |
Delayed_writes | Number of rows written with INSERT DELAYED .
|
Delayed_errors | Number of rows written with INSERT DELAYED for which some error occurred (probably duplicate key ).
|
Flush_commands | Number of executed FLUSH commands.
|
Handler_delete | Number of requests to delete a row from a table. |
Handler_read_first | Number of request to read first the row in a table. |
Handler_read_key | Number of request to read a row based on a key. |
Handler_read_next | Number of request to read next row in key order. |
Handler_read_rnd | Number of request to read a row based on a fixed position. |
Handler_update | Number of requests to update a row in a table. |
Handler_write | Number of requests to insert a row in a table. |
Key_blocks_used | The number of used blocks in the key cache. |
Key_read_requests | The number of request to read a key block from the cache. |
Key_reads | The number of physical reads of a key block from disk. |
Key_write_requests | The number of request to write a key block to the cache. |
Key_writes | The number of physical writes of a key block to disk. |
Max_used_connections | The maximum number of connections that has been in use simultaneously. |
Not_flushed_key_blocks | Keys blocks in the key cache that has changed but hasn't yet been flushed to disk. |
Not_flushed_delayed_rows | Number of rows waiting to be written in INSERT DELAY queues.
|
Open_tables | Number of tables that are open. |
Open_files | Number of files that are open. |
Open_streams | Number of streams that are open (used mainly for logging) |
Opened_tables | Number of tables that has been opened. |
Questions | Number of questions asked from to the server. |
Running_threads | Number of currently open connections. |
Slow_queries | Number of requêtesthat has taken more than long_query_time
|
Uptime | How many seconds the server has been up. |
Commentaires :
Opened_tables
est grand, alors table_cache
est probablement trop petit.
key_reads
est trop grand, alors key_cache
est probablement trop petit. Le taux d'accès au cache est calculé avec la key_reads
/key_read_requests
.
Handler_read_rnd
est grand, alors il y a probablement trop de requêtes qui obligent MySQL a scanner des tables entières, ou il y a des commandes join qui n'utilisent pas les clés à bon escient.
SHOW VARIABLES
affiche quelques variables système de MySQL. Cette commande est disponible avec l'utilitaire mysqladmin variables
command. Si les valeurs par défaut ne conviennent pas, il faut faire les réglages au démarrage, dans la commande de mysqld
. Les informations fournit sont les suivantes, et ressemble fort au tableau ci-dessous :
+------------------------+--------------------------+ | Variable_name | Value | +------------------------+--------------------------+ | back_log | 5 | | connect_timeout | 5 | | basedir | /my/monty/ | | datadir | /my/monty/data/ | | delayed_insert_limit | 100 | | delayed_insert_timeout | 300 | | delayed_queue_size | 1000 | | join_buffer_size | 131072 | | flush_time | 0 | | key_buffer_size | 1048540 | | language | /my/monty/share/english/ | | log | OFF | | log_update | OFF | | long_query_time | 10 | | low_priority_updates | OFF | | max_allowed_packet | 1048576 | | max_connections | 100 | | max_connect_errors | 10 | | max_delayed_threads | 20 | | max_heap_table_size | 16777216 | | max_join_size | 4294967295 | | max_sort_longueur | 1024 | | max_tmp_tables | 32 | | net_buffer_longueur | 16384 | | port | 3306 | | protocol-version | 10 | | record_buffer | 131072 | | skip_locking | ON | | socket | /tmp/mysql.sock | | sort_buffer | 2097116 | | table_cache | 64 | | thread_stack | 131072 | | tmp_table_size | 1048576 | | tmpdir | /machine/tmp/ | | version | 3.23.0-alpha-debug | | wait_timeout | 28800 | +------------------------+--------------------------+
SHOW PROCESSLIST affiche la liste des processus en ligne. Cette commande est aussi disponible avec la mysqladmin processlist
. Avec les droits de process, tous les threads sont visibles. Sinon, seuls les threads utilisateurs sont visibles . KILL
.
KILL
.