怎么查看mysql的ip
时间: 2023-12-03 07:49:02 浏览: 190
如何查看连接MYSQL数据库的IP信息
要查看MySQL的IP地址,可以通过以下方法之一:
1. 可以直接查询MySQL的processlist,使用SQL语句【select SUBSTRING_INDEX(host,':',1) as ip , count(*) from information_schema.processlist】即可获取连接到MySQL的IP地址列表。
2. 如果您在自己的电脑上建立了MySQL数据库,并想在其他电脑上进行连接,可以通过查找您电脑的IP地址来找到MySQL数据库的IP地址。
3. 可以通过在命令行中执行以下命令来获取MySQL的IP地址:【mysql -u root -h127.0.0.1 -e"show processlist\G;"| egrep "Host\:" | awk -F: '{ print $2 }'| sort | uniq -c】。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [如何查mysql的ip地址](https://blog.csdn.net/weixin_30436581/article/details/113714638)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [查看本地MYSQL数据库的IP地址](https://blog.csdn.net/The_dream1/article/details/127257746)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文