I am in a MySQL terminal session but I don’t know what server I am connected to, or what database I am connected to.
Is there a MySQL command that will tell me the host, port, and username and database I am using now?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are MYSQL functions you can use. Like this one that resolves the user:
This will return something like
root@localhostso you get the host and the user.To get the current database run this statement:
Other useful functions can be found here: http://dev.mysql.com/doc/refman/5.0/en/information-functions.html