user699235
user699235

Reputation: 71

find username,databasename and version in mysql?

while using database under MySQL how can i determine my current MySQL version,database name I'm working and logged in username ?

is it possible to get through using query ?

Upvotes: 3

Views: 11952

Answers (2)

Vishwanath Dalvi
Vishwanath Dalvi

Reputation: 36671

Try this.

mysql> select version(),user(),database();
+-----------+----------------+------------+
| version() | user()         | database() |
+-----------+----------------+------------+
| 5.1.41    | root@localhost | bank       |
+-----------+----------------+------------+
1 row in set (0.00 sec)

Upvotes: 9

gbn
gbn

Reputation: 432667

SELECT DATABASE(), USER(), VERSION();

See "Information Functions" in the docs for more details

Upvotes: 4

Related Questions