SQL Argument

SQL Statement

INSERT INTO logins(username, password) 
VALUES ('john', 'john123!'), ('tom', 'tom123!');
---
UPDATE logins 
SET password = 'change_password' 
WHERE id > 1;

SQL Query

SELECT * FROM logins LIMIT 1, 2;
---
SELECT * FROM logins WHERE username LIKE 'admin%';

Find users from known database

SELECT USER()
SELECT CURRENT_USER()
SELECT * from mysql.user

User privileges

SELECT super_priv FROM mysql.user

INFORMATION_SCHEMA

mysql> SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA;
+--------------------+
| SCHEMA_NAME        |
+--------------------+
| mysql              |
| information_schema |
| performance_schema |
| ilfreight          |
| dev                |
+--------------------+
6 rows in set (0.01 sec)

LOAD_FILE

SELECT LOAD_FILE('/etc/passwd');

Last updated