mysql commonly used system commands finishing

Performance recently in charge of a project, often require some configuration mysql, parameter modification and other operations, under the following compilation of relevant command, retained it! !

 

-------system status-------

## show executing thread.
      PROCESSLIST Show;
## mysql query the current version of.
  the SELECT @@ Version;
## see the port mysql instance.
  Variables like Show 'Port';
## See data socket instance.
  Variables like Show 'Socket';
## See data path example.
  the Variables like Show 'datadir';
## show a command of all the database name.
  Databases Show;
## display command structure table structure and columns.
  call_history desc;
## to view the execution plan statement.
  EXPLAIN;
## see the table of the index case.
  index from call_history Show;
## statistics table view, pay attention to cut inside the library system to perform
  the SELECT * STATISTICS from the WHERE table_name = call_history;
## query packet size definition.
  @@ max_allowed_packet the SELECT;
## View master status. You can view the last (latest) binlog log a number of names and their last action event end point pos (Position) value
  Master Status Show;
## View slave status
  Show slave Status;
## see all log files, execute on the primary server. (Ie see all binlog log list)
  Show Master logs;
## show the most recent warning details.
  show warnings;

 

Parameter --------- -------- mysql


## parameter settings specified criteria queries, such as queries with parameters set at the beginning of log_slave.
  the Variables like Show 'log_slave%';
## to see whether to open the slow query log; ON represents the open. It can be opened online. = Global slow_query_log. 1 SET;
   Show Variables like 'slow_query_log';
## See slow query log path.
   Variables like Show 'slow_query_log_file';
## See slow query defined threshold, in seconds. Record query is greater than this value, the value is not included.
  Variables like Show 'long_query_time';
## See log output format (file or table).
  Variables like Show 'log_output';
## log view time information, UTC time or time SYSTEM.
  the Variables like Show 'log_timestamps';
## to see whether to open the slow query log from the server, ON represents the open.
  the Variables like Show 'log_slow_slave_statements';
## will not use the index SQL statements recorded in the slow query log.
  show variables like 'log_queries_not_using_indexes';
Set ## for use with the above parameters, limiting the number of times per minute, the slow query log, the index is not used. Avoid rapid growth of the log.
  show variables like 'log_throttle_queries_not_using_indexes';
temporary tables created ## View storage engine type.
  like the Variables Show "default% tmp%";
## query log file size.
  show variables like 'innodb_log_file_size';
size ## queries page. Once the database is done by innodb_page_size setting, follow-up can not be changed. innodb_page_size is for the common table, compressed table without restriction.
  Variables like Show 'innodb_page_size';
## see the size of the buffer pool, each time the data is read through the buffer pool; buffer pool when the data is not required, only to acquire the hard disk. Set this value the better. buffer pool is also based page (page) as a unit, and the size and innodb_page_size consistent.
  show variables like 'innodb_buffer_pool_size';
the number of buffer pool ## is provided. A plurality of hot instance may be broken up and improve concurrency (recommended numerical values provided the cpu)
  Show Variables like 'innodb_buffer_pool_instances';
## check the status of the buffer pool. (See the default storage engine types: the SELECT @@ default_storage_engine;)
  Show Engine InnoDB Status;
## line adjustment innodb_buffer_pool_size. Versions prior to 5.7 MySQL, modify the value, need to restart.
  Global innodb_buffer_pool_size = 2 * SET 1024 * 1024 * 1024;
## after MySQL 5.6, can dump the data buffer pool at the time of shutdown, startup and then into Load buffer pool. This feature can automatically start the warm-up when MySQL, without human intervention.
  Variables like Show 'innodb_buffer_pool_dump_at_shutdown';
## dumpd percentage, each buffer pool file instead of the whole.
  show variables like 'innodb_buffer_pool_dump_pct';
load dump when ## startup files, to restore the buffer pool. dump more you start slower.
  show variables like 'innodb_buffer_pool_load_at_startup';
information view lock ## is performed in the database sys. Note that the switching system to perform database
  SELECT * from innodb_lock_waits;
## See isolation level
  Show Variables like 'transaction_isolation';
## set the isolation level.
  set transaction_isolation = 'read-committed' ;

  Variables like Show 'innodb_print_all_deadlocks';
## Master Thread refresh buffer redo to the second logfile. Version 5.7 can set the refresh interval, the default is 1 second.
  like the Variables Show "% innodb_flush_log_at_timeout%";
## View binlog type. statement recorded SQL statements; those rows ROW record SQL statements operations (change of line); mixed and blended statement Row format (not recommended)
  ; Show the Variables like 'binlog_format'
except under ## to view a database account, root root authority account
  select * from mysql.db WHERE db LIKE ' db_name';

 

Guess you like

Origin www.cnblogs.com/qkblogs/p/12625377.html