How to use mysql in commandline

Sep 18, 2016

Some useful mysql commands.

Create a New User and Grant Permissions

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *. * TO 'ssuser'@'localhost';
GRANT ALL PRIVILEGES ON [database name].[table name] TO 'newuser'@'localhost';
FLUSH PRIVILEGES;

Basic interaction

show databases;
show tables;
describe tables;
use [databaseName];

Do Not Remain Silent

Back To Top