Reputation: 71
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
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
Reputation: 432667
SELECT DATABASE(), USER(), VERSION();
See "Information Functions" in the docs for more details
Upvotes: 4