通过SQL命令显示MySQL主机?
要通过SQL命令显示MySQL主机,请使用系统变量“hostname”。
以下是显示主机的查询语句−
mysql> select @@hostname;
这是输出结果−
+-----------------+
| @@hostname |
+-----------------+
| DESKTOP-QN2RB3H |
+-----------------+
1行受影响 (0.00 sec)
或者,您可以使用“show variables”命令来显示MySQL主机。
show variables where Variable_name like '%host%';
以下是输出结果−
+-------------------------------+-----------------+
| Variable_name | Value |
+-------------------------------+-----------------+
| host_cache_size | 279 |
| hostname | DESKTOP-QN2RB3H |
| performance_schema_hosts_size | -1 |
| report_host | |
+-------------------------------+-----------------+
4行受影响 (0.07 sec)
阅读更多:MySQL 教程