
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Show MySQL Host via SQL Command
To display MySQL host via SQL command, use the system variable hostname.
Query 1
The following is the query to display the host ?
mysql > select @@hostname;
Output
Here is the output ?
+-----------------+ | @@hostname | +-----------------+ | DESKTOP-QN2RB3H | +-----------------+ 1 row in set (0.00 sec)
Query 2
Or you can use "show variables" command to show MySQL host via SQL command.
show variables where Variable_name like '%host%';
Output
The following is the output ?
+-------------------------------+-----------------+ | Variable_name | Value | +-------------------------------+-----------------+ | host_cache_size | 279 | | hostname | DESKTOP-QN2RB3H | | performance_schema_hosts_size | -1 | | report_host | | +-------------------------------+-----------------+ 4 rows in set (0.07 sec)
Advertisements