fir3net
PPS-Firenetbanner-780.5x190-30-03-17

MySQL - How to Create/Assign a User to a Database

Below shows you the syntax required to assign a user (along with password) to a MySQL database.

This is useful for assigning separate permissions across your databases rather then just assigning root access across the board.

mysql> GRANT ALL ON <DATABASE>.* TO <USERNAME>@localhost IDENTIFIED BY '<PASSWORD>';

Tags: MySQL

About the Author

RDonato

R Donato

Rick Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001