mycli

yaourt -S mycli
mycli -u root -p
CREATE DATABASE newdatabase;
USE newdatabase
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'newpassword';
GRANT ALL PRIVILEGES ON newdatabase.* TO 'newuser'@'localhost';
mysqladmin -u root password 'new-password'
mysqladmin -u root -h localhost password 'new-password'
SET PASSWORD FOR 'user'@'localhost' = PASSWORD('password');
-- or
update mysql.user set password=PASSWORD(‘新password) where User=’root’;­
-- and then
flush privileges;­
SELECT * FROM mysql.user;
SHOW DATABASES;
SELECT host, USER, password FROM mysql.user;
SHOW GRANTS FOR username@localhost;
REVOKE ALL privileges ON newdatabase.* FROM 'newuser'@'localhost';
FLUSH privileges;
SHOW DATABASES
SHOW TABLES