mysql查看主库ip
时间: 2023-09-19 21:11:13 浏览: 225
如何查看连接MYSQL数据库的IP信息
要查看MySQL主库的IP,你可以使用以下命令:
```
SELECT @@hostname;
```
这个命令会返回MySQL主库的主机名。如果你想要查看主库的IP地址,可以使用以下命令:
```
SELECT @@hostname, @@port;
```
其中,`@@hostname`返回主库的主机名,`@@port`返回主库的端口号。将这两个值结合起来,你就可以得到主库的完整IP地址。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [批量查看mysql多从状态和修改多从主库指向](https://blog.csdn.net/weixin_31143391/article/details/113298373)[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%"]
- *3* [MySQL主从复制与读写分离](https://blog.csdn.net/Y_S_J_112/article/details/127677112)[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 ]
阅读全文