Switch to the desired database:
USE db_name;
Create a new entry:
INSERT INTO table_name (column1, ..., columnN) VALUES (value1, ..., valueN);
INSERT INTO table_name VALUES (value1, ..., valueN); //shorter versions when values for all columns provided
Show all the entries (rows) in the database:
SELECT * FROM table_name;
SELECT * FROM table_name WHERE column1 = 'value1';
SELECT * FROM table_name WHERE column1 = 'value1' ORDER BY columnN ASC; //DESC
SELECT * FROM table_name WHERE column1 LIKE '%something%'; // '%' is a wildcard
Update a row:
UPDATE table_name SET column1='value', ... WHERE columnX = 'valueX';
Remove a row entry from a database:
DELETE FROM table_name WHERE column1 = 'value1';
Clear all data (all rows) from a database table:
TRUNCATE TABLE table_name
Create a new user and grant permission:
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON db_name.* TO 'new_user'@'localhost';
FLUSH PRIVILEGES;
SHOW GRANTS FOR 'username'@'localhost';
View the table definition:
DESCRIBE table_name;