Install mycli
Login to mysql shell
Create database
CREATE DATABASE newdatabase;
USE newdatabase
Create user and grant the database access
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'newpassword';
GRANT ALL PRIVILEGES ON newdatabase.* TO 'newuser'@'localhost';
Change credential
Show users
SELECT * FROM mysql.user;
Show grants
SHOW DATABASES;
SELECT host, USER, password FROM mysql.user;
SHOW GRANTS FOR username@localhost;
Remote grants
REVOKE ALL privileges ON newdatabase.* FROM 'newuser'@'localhost';
FLUSH privileges;
List databases
List tables