I'm somehow in a MySQL session but I don't know what server I am connected to, etc. Is there a MySQL command that will tell me the host, port, and username I am using now?
Thanks!
I'm somehow in a MySQL session but I don't know what server I am connected to, etc. Is there a MySQL command that will tell me the host, port, and username I am using now? Thanks! |
|||||||||||||
|
There are MYSQL function you can use for that like this one that resolves the user:
This will return somethin like 'root@localhost' so you get the host and the user. To get the current database run this statement:
These and also some other useful functions can be found here: http://dev.mysql.com/doc/refman/5.0/en/information-functions.html |
|||||
|
You can use the status command in MySQL client.
|
|||
|
If you want to know the port number of your local host on which Mysql is running you can use this query on MySQL Command line client --
It will give you the port number on which MySQL is running. If you want to know the hostname of your Mysql you can use this query on MySQL Command line client --
It will give you the hostname for mysql. If you want to know the username of your Mysql you can use this query on MySQL Command line client --
It will give you the username for mysql. |
|||
|