How to add a MySQL user
Only users granted privileges are able to access MySQL databases. This means that databases can only be accessed and modified if they are assigned a user or users. You can create and add users to MySQL databases within the Hosting Manager.
To know how to access your Hosting Manager, click the link below:
How to create a MySQL user
To create a user to access your MySQL database/s, follow the steps below:
- Click Sign Up / Log In at the top of this page.
- Select Hosting Manager from the drop-down menu.
- Enter your username and password, and click Log In.
- On the Home page, click the word Databases or the [ v ] arrow symbol on the right side.
- Click the MySQL Databases button, which is next to MySQL Database Wizard icon.
- On the next page, under MySQL Users, fill out the following fields under Add New User:
Username | This is the new privileged user’s name. |
---|---|
Password | This will serve as the key that will enable you to access your MySQL database. The system will tell you how weak or strong your password is when you type it in the appropriate fields. If you find it difficult to make a strong enough password for your email, you can let the system create one for you. Click the Password Generator button. In the pop-up box, copy the generated password and paste that in the Password fields. You can also choose to check I have copied this password in a safe place. Then, click Use Password. This will automatically copy and paste the generated password in the Password fields. Important Note: Make sure you have actually saved the generated password in a safe and easy to recall place.
|
Password (Again) | This is only for confirmation and should be the same as in the Password field above. |
- Click Create User.
- On the next page, you will get the following notification:
√ You have successfully created a MySQL user named “hostingname_newuser”.
Congratulations, you now know how to create a privileged user.
How to add a user to a MySQL database
After creating a user, you need to specify which database the said user should be able to access. You do this by adding the user to the appropriate MySQL database.
To add a user to a MySQL database, follow the steps below:
- Click Sign Up / Log In at the top of this page.
- Select Hosting Manager from the drop-down menu.
- Enter your username and password, and click Log In.
- On the Home page, click the word Databases or the [ v ] arrow symbol on the right side.
- Click the MySQL Databases button, which is next to MySQL Database Wizard icon.
- On the next page, under MySQL Users, go to Add User To Database. Click the User and Database fields, and match the user you just created with the database you want the said user to be able to access. Click Add.
- Next, this is where you will set the user privileges. Check the permitted actions you would like to grant the user within the corresponding database. You can also choose to check All Privileges to give the user permission to do everything on the list. Click Make Changes.
- On the next page, you will get the following notification:
√ User “hostingname_user” was added to the database “hostingname_database” with the requested privileges.
Congratulations, you now know how to grant a user access to a MySQL database.
e.g. username_user01, username_database01
For information on how to manage MySQL database user privileges, please view the guide below.
If you are creating a database and user for the first time, it is recommended that you use the MySQL Database Wizard feature. This is because this feature offers an easier step-by-step process for users.
To know how to create a MySQL database and user, click the link below: