SQL Command – Create user and delete user

MySQL command

Create user

CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';

Notice. The ‘localhost’ means the accessible scope of the user is limited to the localhost.

If your user account needs to be accessible from any IP address, change ‘localhost’ to ‘%’.

CREATE USER 'user'@'%' IDENTIFIED BY 'password';

Delete a user

DROP USER 'user'@localhost;

oliver

Leave a Reply

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


*