views:

11

answers:

1

Hello.

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!

A: 

There are MYSQL function you can use for that like this one that resolves the user:

SELECT USER();

This will return somethin like 'root@localhost' so you get the host and the user.

To get the current database run this statement:

SELECT DATABASE();

These and also some other useful functions can be found here: http://dev.mysql.com/doc/refman/5.0/en/information-functions.html

Kau-Boy
Thanks homeslice.
brutustea