首页 > 代码库 > MySQL查看当前用户

MySQL查看当前用户

技术分享
 1 mysql> select current_user(); 2 +----------------+ 3 | current_user() | 4 +----------------+ 5 | root@localhost | 6 +----------------+ 7 1 row in set 8  9 mysql> select current_user;10 +----------------+11 | current_user   |12 +----------------+13 | root@localhost |14 +----------------+15 1 row in set16 17 mysql> select user();18 +----------------+19 | user()         |20 +----------------+21 | root@localhost |22 +----------------+23 1 row in set24 25 mysql> 
View Code

3种方式都可以

MySQL查看当前用户