Good commands for MySQL

Add user
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON database.* TO 'username'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;



Update users password
ALTER USER 'user-name'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD'; FLUSH PRIVILEGES;

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *