How to Add and Assign User to MySQL Database

  •   22/05/2018 12:22 PM
  •  

1) Login to your cPanel account.


2) Select “MySQL Databases” as shown below.



3) Type the name of your new database under “Create New Database” and press “Create Database”.

You shall see the message: “Added the database yourusername_databasename”. Hit the “Go back” button.



4) Now, scroll down to the bottom to “MySQL Users”.  Enter your preferred username and password and hit “Create User”. 

You can also choose a randomly generated password by selecting “Generate Password”.




5) You shall see the message “You have successfully created a MySQL user named “youruser_newname”.” Hit the “Go Back” button.




6) Next, we scroll down to "Add Username to Database" section and assign our newly created username to our newly created database. In this example shown below, user "xyz_data" will be assigned to "xyz_newdatabase". Remember to hit the "Add" button.





7) Tick on “All Privileges” and hit the “Make Changes” button.





8) You shall see that your new user is now assigned to your new database.