为什么80%的码农都做不了架构师?>>>   

首先需要登录到mysql中。

总共有三个命令:

1、status

mysql> status--------------mysql  Ver 14.14 Distrib 5.5.30, for Linux (x86_64) using readline 5.1Connection id:          96Current 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:       10Connection:             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,进行上下翻页

Aborted_clients 由于客户没有正确关闭连接已经死掉,已经放弃的连接数量。

Aborted_connects 尝试已经失败的MySQL服务器的连接的次数。

Connections 试图连接MySQL服务器的次数。

Created_tmp_tables 当执行语句时,已经被创造了的隐含临时表的数量。

Delayed_insert_threads 正在使用的延迟插入处理器线程的数量。

Delayed_writes 用INSERT DELAYED写入的行数。

Delayed_errors 用INSERT DELAYED写入的发生某些错误(可能重复键值)的行数。

Flush_commands 执行FLUSH命令的次数。

Handler_delete 请求从一张表中删除行的次数。

Handler_read_first 请求读入表中第一行的次数。

Handler_read_key 请求数字基于键读行。

Handler_read_next 请求读入基于一个键的一行的次数。

Handler_read_rnd 请求读入基于一个固定位置的一行的次数。

Handler_update 请求更新表中一行的次数。

Handler_write 请求向表中插入一行的次数。

Key_blocks_used 用于关键字缓存的块的数量。

Key_read_requests 请求从缓存读入一个键值的次数。

Key_reads 从磁盘物理读入一个键值的次数。

Key_write_requests 请求将一个关键字块写入缓存次数。

Key_writes 将一个键值块物理写入磁盘的次数。

Max_used_connections 同时使用的连接的最大数目。

Not_flushed_key_blocks 在键缓存中已经改变但是还没被清空到磁盘上的键块。

Not_flushed_delayed_rows 在INSERT DELAY队列中等待写入的行的数量。

Open_tables 打开表的数量。

Open_files 打开文件的数量。

Open_streams 打开流的数量(主要用于日志记载)

Opened_tables 已经打开的表的数量。

Questions 发往服务器的查询的数量。

Slow_queries 要花超过long_query_time时间的查询数量。

Threads_connected 当前打开的连接的数量。

Threads_running 不在睡眠的线程数量。

Uptime 服务器工作了多少秒。

转载于:https://my.oschina.net/daquan/blog/480866

linux下查看mysql的当前连接情况相关推荐

  1. Linux下查看MySQL连接、启动、连接数

    ** 1.Linux下查看mysql是否安装并卸载 ** 指令 ps -ef|grep mysql 得出结果 root 17659 1 0 2011 ? 00:00:00 /bin/sh /usr/b ...

  2. linux查看mysql连接日志文件,linux下查看mysql日志文件的方法

    查看mysql日志方法: mysql默认不允许我们查看日志.需要更改一些设置 1 vi 更改配置文件 允许用户查看日志文件 sudo vi /etc/mysql/mysql.conf.d/mysqld ...

  3. Linux下查看MySQL的安装路径

    Linux下查看mysql.apache是否安装,并卸载. 指令 ps -ef|grep mysql 得出结果 root     17659     1  0  2011 ?        00:00 ...

  4. linux 查询内存和核心数,Linux下查看操作系统信息、内存情况及cpu信息:cpu个数、核心数、线程数...

    1.查看物理CPU的个数 [root@MysqlCluster01 ~]# cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc ...

  5. Linux下设置mysql允许远程连接

    最近在Linux上安装了Mysql,然后在Windows环境下通过Navicat来连接时,出现报错:1045 Access denied for user 'root'@'XXX' (using pa ...

  6. Linux下查看Go语言软件运行情况

    在Linux下,使用"jps"可以查看用Java语言写的软件的运行情况,如果要查看GO语言写的软件的运行情况,可以使用"gops",但这不是系统自带的,需要进行 ...

  7. linux下查看mysql数据库的字段类型_系统运维|[小白技巧]如何在Linux上检查MySQL数据表的存储引擎类型...

    提问: 我想要知道我的MySQL数据库是MyISAM还是Innodb类型.我该如何检查MySQL数据库表的类型? MySQl主要使用两种存储引擎:MyISAM 和 Innodb.MyISAM是非事务的 ...

  8. linux下查看mysql版本的四种方法

    Linux查看MySQL版本的四种方法 1 在终端下执行 mysql -V 2 在help中查找 mysql --help |grep Distrib 3 在mysql 里查看 select vers ...

  9. Linux 下查看进程内的线程情况 ps, top 命令

    线程是现代操作系统上进行并行执行的一个流行的编程方面的抽象概念.当一个程序内有多个线程被拆分出用以执行多个流时,这些线程就会在它们之间共享特定的资源(如,内存地址空间.打开的文件),以使拆分开销最小化 ...

最新文章

  1. C语言的链表—完整代码
  2. python的try菜鸟_python异常处理try except过程解析
  3. 解读在校园招聘中人工智能常考的笔试题
  4. 数据恢复knowledge
  5. android 注册、登录实现程序
  6. 【计算理论】可判定性 ( 丘奇-图灵论题 | 可判定性引入 | 图灵机语言 | 图灵机结果 | 判定机 | 部分函数与全部函数 | 可判定性定义 )
  7. UA MATH574M 统计学习II 二元分类例子与高维问题
  8. 《系统集成项目管理工程师》必背100个知识点-02项目组织方式和特点
  9. 【学术相关】建议收藏,到底哪些行为是学术不端?
  10. 实时音视频流媒体传输的思考和实践
  11. 极速理解设计模式系列:2.观察者模式(Observer Pattern)
  12. 分布式数据库的字符集
  13. MixGo V1.0 发布,混合型高性能 Go 框架
  14. 佳能g2810打印机扫描怎么用_佳能 G2810说明书.pdf
  15. linux中文输入法配置
  16. 这是一篇随笔 hello world
  17. 【论文笔记】(VLDB 2020) A Benchmarking Study of Embedding-based Entity Alignment for Knowledge
  18. 【同一电脑原win用户信息迁移到新Win用户下python interpreter显示 no interpreter问题】
  19. vue详解(一)概述和基础语法
  20. 虚拟机模拟实机软盘教程

热门文章

  1. JQ表单序列化变成 对象
  2. [单选题]$array = array('a','b','c','d'); $array_now = array_splice($array,2); print_r($array_now);...
  3. 通过wifi调试Android程序
  4. 一个计算机爱好者的不完整回忆(二十八)关于计算机书籍
  5. C# 与java区别总结 收集
  6. checkStyle -- 代码风格一致
  7. 全国计算机等级考试题库二级C操作题100套(第62套)
  8. mysql安装主从配置_MySQL安装与主从配置
  9. 访问数据库_Lua 数据库访问
  10. SQLServer常用的配置函数笔记