MySQL administration

Databases · 6 of 9
On this page (2)
  1. Connection
  2. User

Connection

Connect to DB from CLI

mysql -u {$user} -p    

User

See current logged user SELECT CURRENT_USER();

Change password when we know the old one
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('myNewPassword');
Create new User
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
Grant Privileges to user
GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost'
	WITH GRANT OPTION;
Found it useful? Share it
LinkedIn