Mysql Redis PostgreSQL数据库查看客户端连接
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Mysql Redis PostgreSQL数据库查看客户端连接,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3689字,纯文字阅读大概需要6分钟。
内容图文
![Mysql Redis PostgreSQL数据库查看客户端连接](/upload/InfoBanner/zyjiaocheng/506/372a6c4f94b14a28b440b6fa8ee2cecc.jpg)
[root@VM_8_24_centos ~]# redis-cli -h 10.0.4.6 -a yourpassword
10.0.4.6:6379> client list
addr=100.120.205.19:1024 fd=9 cmd=client age=3 idle=0 proxy=33c6e51a9cc4771fb5836880f86a860f
10.0.4.6:6379> exit
[root@VM_8_24_centos ~]#
Myslq数据库查看连接的客户端
[root@VM_8_24_centos ~]# mysql -uroot -h 10.0.4.3 -pyourpassword
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 38411
Server version: 5.6.28-cdb2016-log 20180130
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
MySQL [(none)]> SELECT substring_index(host, ‘:‘,1) AS host_name,state,count(*) FROM information_schema.processlist GROUP BY state,host_name;
+-----------+------------------------------------------------------------------+----------+
| host_name | state | count(*) |
+-----------+------------------------------------------------------------------+----------+
| | | 2 |
| 10.2.8.24 | executing | 1 |
| | Master has sent all binlog to slave; waiting for binlog to be up | 1 |
+-----------+------------------------------------------------------------------+----------+
3 rows in set (0.00 sec)
MySQL [(none)]> exit
Bye
[root@VM_8_24_centos ~]#
PostgreSQL查看连接的客户端
[root@VM_8_24_centos ~]# psql -h 10.0.4.5 -U postgresadmin -d postgres
Password for user postgresadmin:
psql (9.2.24, server 9.5.4)
WARNING: psql version 9.2, server version 9.5.
Some psql features might not work.
Type "help" for help.
postgres=> select * from pg_stat_activity;
datid | datname | pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_
start | xact_start | query_start | state_change | waiting | state | back
end_xid | backend_xmin | query
-------+----------+-------+----------+---------------+------------------+-------------+-----------------+-------------+----------------
--------------+-------------------------------+-------------------------------+-------------------------------+---------+--------+-----
--------+--------------+---------------------------------
13295 | postgres | 37774 | 10 | postgres | | | | |
| | | | | |
| | <insufficient privilege>
13295 | postgres | 16485 | 10 | postgres | | | | |
| | | | | | |
| <insufficient privilege>
13295 | postgres | 16539 | 16384 | postgresadmin | psql | 10.2.8.24 | | 56434 | 2019-03-21 10:28:44.
91409+08 | 2019-03-21 10:28:58.604402+08 | 2019-03-21 10:28:58.604402+08 | 2019-03-21 10:28:58.604405+08 | f | active | |
1837 | select * from pg_stat_activity;
(3 rows)
postgres-> \q
[root@VM_8_24_centos ~]#
Mysql Redis PostgreSQL数据库查看客户端连接
标签:psql post code end bin port some moni string
本文系统来源:https://blog.51cto.com/jerrymin/2366480
内容总结
以上是互联网集市为您收集整理的Mysql Redis PostgreSQL数据库查看客户端连接全部内容,希望文章能够帮你解决Mysql Redis PostgreSQL数据库查看客户端连接所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。