All Linux HowTo's

Create a new MySQL user, grant permissions and set the password in one command

Share This:

This one-liner shows how to create a new MySQL user, grant permissions and set the password:

GRANT ALL PRIVILEGES ON mydb.* To 'myuser'@'%' IDENTIFIED BY 'mypassword';

Then run:

FLUSH PRIVILEGES

And that’s it.

Similar Posts: