MySQL

Some of the queries in the table below can only be run by an admin. These are marked with (PRIV) at the description.

Version

SELECT @@version;

Comments

SELECT 1; #comment
SELECT /*comment*/1;

Current User

SELECT user();
SELECT system_user;

List Users (PRIV)

SELECT user FROM mysql.user;

List Password Hashes (PRIV)

SELECT host, user, password FROM mysql.user;

List Privileges (PRIV)

List DBA Accounts (PRIV)

Current Database

List Databases

List Tables

List Columns

Find Tables from Column Name

Hostname, IP Address

Create Users (PRIV)

Delete Users (PRIV)

Make User DBA (PRIV)

Location of DB Files

Read Files (PRIV)

Write Files (PRIV)

Last updated

Was this helpful?