Create a User¶
CREATE USER '${USERNAME}'@'${HOSTNAME}' IDENTIFIED BY '${PASSWORD}'; You can use % as the host to act as a wildcard.
Alter a User¶
ALTER USER '${USERNAME}'@'${HOSTNAME}' IDENTIFIED BY '${PASSWORD}'; Root¶
Root is identified by root@localhost:
ALTER USER 'root'@'localhost' IDENTIFIED BY '${NEW_PASS}'; List Users¶
SELECT `User`,`Host` FROM `mysql`.`user`; Delete a User¶
DROP USER '${USERNAME}'@'${HOSTNAME}';