首先需要登录到mysql中。
总共有三个命令:
1、status
mysql> status -------------- mysql Ver 14.14 Distrib 5.5.30, for Linux (x86_64) using readline 5.1Connection id: 96
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.30 MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 7 hours 58 min 1 secThreads: 11 Questions: 16093 Slow queries: 0 Opens: 70 Flush tables: 1 Open tables: 41 Queries per second avg: 0.561
2、show processlist(查看当前用户的连接,root用户查看所有的)
mysql> show processlist; +----+------+-----------------+-------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------------+-------+---------+------+-------+------------------+ | 1 | root | localhost:40214 | b3log | Sleep | 18 | | NULL | | 2 | root | localhost:40215 | b3log | Sleep | 18 | | NULL | | 3 | root | localhost:40216 | b3log | Sleep | 18 | | NULL | | 4 | root | localhost:40217 | b3log | Sleep | 18 | | NULL | | 5 | root | localhost:40218 | b3log | Sleep | 18 | | NULL | | 6 | root | localhost:40219 | b3log | Sleep | 18 | | NULL | | 7 | root | localhost:40220 | b3log | Sleep | 18 | | NULL | | 8 | root | localhost:40221 | b3log | Sleep | 18 | | NULL | | 9 | root | localhost:40222 | b3log | Sleep | 18 | | NULL | | 10 | root | localhost:40223 | b3log | Sleep | 18 | | NULL | | 97 | root | localhost | NULL | Query | 0 | NULL | show processlist | +----+------+-----------------+-------+---------+------+-------+------------------+ 11 rows in set (0.00 sec)
3、show status
| Qcache_queries_in_cache | 0 | | Qcache_total_blocks | 0 | | Queries | 16137 | | Questions | 2 | | Rpl_status | AUTH_MASTER | | Select_full_join | 0 | | Select_full_range_join | 0 | | Select_range | 0 | | Select_range_check | 0 | | Select_scan | 0 | | Slave_heartbeat_period | 0.000 | | Slave_open_temp_tables | 0 | | Slave_received_heartbeats | 0 | | Slave_retried_transactions | 0 | | Slave_running | OFF | | Slow_launch_threads | 0 | | Slow_queries | 0 | | Sort_merge_passes | 0 | | Sort_range | 0 | | Sort_rows | 0 | | Sort_scan | 0 | | Ssl_accept_renegotiates | 0 | | Ssl_accepts | 0 | | Ssl_callback_cache_hits | 0 | | Ssl_cipher | | | Ssl_cipher_list | | | Ssl_client_connects | 0 | | Ssl_connect_renegotiates | 0 | | Ssl_ctx_verify_depth | 0 | | Ssl_ctx_verify_mode | 0 | | Ssl_default_timeout | 0 | | Ssl_finished_accepts | 0 | | Ssl_finished_connects | 0 | | Ssl_session_cache_hits | 0 | | Ssl_session_cache_misses | 0 | | Ssl_session_cache_mode | NONE | | Ssl_session_cache_overflows | 0 | | Ssl_session_cache_size | 0 | | Ssl_session_cache_timeouts | 0 | | Ssl_sessions_reused | 0 | | Ssl_used_session_cache_entries | 0 | | Ssl_verify_depth | 0 | | Ssl_verify_mode | 0 | | Ssl_version | | | Table_locks_immediate | 2135 | | Table_locks_waited | 0 | | Tc_log_max_pages_used | 0 | | Tc_log_page_size | 0 | | Tc_log_page_waits | 0 | | Threads_cached | 0 | | Threads_connected (连接数) | 11 | | Threads_created | 98 | | Threads_running | 1 | | Uptime | 28851 | | Uptime_since_flush_status | 28851 | +------------------------------------------+-------------+ 312 rows in set (0.00 sec)
如果不能看到全部 ,按ctrl + pageup或pagedown,进行上下翻页
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于