Managing database users
To access MySQL databases, you must first create at least one user. The following procedures describe how to manage MySQL database users using cPanel.
Creating a database user
- Log in to cPanel.
- In the DATABASES section of the cPanel home screen, click MySQL Databases:
- Under Add New User, in the Username text box, type the MySQL username.
- In the Password text box, type the user password.
-
In the Password (Again) text box, retype the user password.
You can click
and cPanel generates a random, strong password for you. - Click . cPanel creates the database user.
Changing a user's password
You can change a database user's password. You may want to do this for security reasons (changing passwords periodically is a good security practice), or you may need to do this if you forget the password.
To change a MySQL user's password, follow these steps:
- Log in to cPanel.
- In the DATABASES section of the cPanel home screen, click MySQL Databases:
- Under Current Users, locate the user for which you want to change the password, and then click Change Password.
-
In the Password and Password (Again) text boxes, type the new password.
You can clickand cPanel generates a random, strong password for you. - Click . The new password takes effect immediately.
Renaming a user
To rename a MySQL user, follow these steps:
- Log in to cPanel.
- In the DATABASES section of the cPanel home screen, click MySQL Databases:
- Under Current Users, locate the user that you want to rename, and then click Rename.
- In the New name text box, type the new name, and then click . cPanel renames the user.
Deleting a user
When you delete a user, the user and its database permissions are deleted.
Make sure you do not have any applications that currently use the database user!
|
To delete a MySQL user, follow these steps:
- Log in to cPanel.
- In the DATABASES section of the cPanel home screen, click MySQL Databases:
- Under Current Users, locate the user that you want to delete, and then click Delete.
- Click to confirm the deletion.
Managing databases
After you create a database user, you are ready to create a database and associate the user with the new database.
Creating a database
- Log in to cPanel.
- In the DATABASES section of the cPanel home screen, click MySQL Databases:
- Under Create New Database, in the New Database text box, type the name of the database.
- Click . cPanel creates the database.
Adding a user to a database
- Log in to cPanel.
- In the DATABASES section of the cPanel home screen, click MySQL Databases:
- Under Add User to Database, in the User list box, select the user that you want to add.
- In the Database list box, select the database.
- Click .
- Select the check boxes to grant the user specific privileges, or select the ALL PRIVILEGES check box to grant the user all permissions to the database.
- Click . cPanel adds the user to the database.
Checking and repairing a database
You can check MySQL databases for errors or possible corruption. If a database check reveals problems, you can repair the database as well.
To check and repair a database, follow these steps:
- Log in to cPanel.
- In the DATABASES section of the cPanel home screen, click MySQL Databases:
- To check a database:
- Under Modify Databases, in the Check Database list box, select the database.
- Click .
-
If a database check indicates problems with a database, you can repair it:
- Under Modify Databases, in the Repair Database list box, select the database.
- Click
Revoking privileges from a database user
When you revoke a database user's privileges, the user can no longer access the database. To do this, follow these steps:
- Log in to cPanel.
- In the DATABASES section of the cPanel home screen, click MySQL Databases:
- Under Current Databases, locate the user for which you want to revoke privileges, and then click the trash can
icon.
- Click .
Deleting a database
Before you delete a database, make sure that you have a backup copy if you want to save any information that it contains.
When you delete a database, any associated users are not deleted. However, all privileges users have for that database are revoked.
|
To delete a MySQL database, follow these steps:
- Log in to cPanel.
- In the DATABASES section of the cPanel home screen, click MySQL Databases:
- Under Current Databases, locate the database that you want to delete, and then click Delete.
- Click . cPanel deletes the database.