1.获取执行查询的用户名
- select user()
- select current_user
2.只适用于MySQL5.0或更高的版本
- select schema_name from information_schema.schemata
- select table_schema,table_name from information_schema.tables where table_schema!='customer_db'
- select table_schema,table_name,column_name from information_schema.columns
3.列举授予各种用户的权限
select grantee,privilege_type,is_grantable from information_schema.user_privileges
select grantee,table_schema,privilege_type from information_schema.schema_privileges
4.获取数据库文件保存目录
SELECT @@datadir
5.获取MySQL哈希口令,获取后使用John the Ripper来恢复原始口令
SELECT user,password from mysql.user;