Managing PostgreSQL databases and users in cPanel
Learn how to use cPanel to manage PostgreSQL databases and database users. Get instructions on creating a database or database user, repairing a database and more.
This article describes how to use cPanel to manage PostgreSQL databases and users.
Managing database users
To access PostgreSQL databases, you must first create at least one user. The following procedures describe how to manage PostgreSQL database users using cPanel.
Creating a database user
To create a PostgreSQL user, follow these steps:
-
Log in to cPanel.
Note
If you do not know how to log in to your cPanel account, please see this article.
-
Open the PostgreSQL Databases tool:
-
If you are using the Jupiter theme, on the Tools page, in the Databases section, click PostgreSQL Databases:
-
If you are using the Paper Lantern theme, in the DATABASES section of the cPanel home page, click PostgreSQL Databases:
-
Under Add New User, in the Username text box, type the PostgreSQL username.
-
In the Password text box, type the user password.
-
In the Password (Again) text box, retype the user password.
Tip
You can click Password Generator and cPanel generates a random, strong password for you.
- Click Create User. 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 PostgreSQL user's password, follow these steps:
-
Log in to cPanel.
Note
If you do not know how to log in to your cPanel account, please see this article.
-
Open the PostgreSQL Databases tool:
-
If you are using the Jupiter theme, on the Tools page, in the Databases section, click PostgreSQL Databases:
-
If you are using the Paper Lantern theme, in the DATABASES section of the cPanel home page, click PostgreSQL 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.
Tip
You can click Password Generator and cPanel generates a random, strong password for you.
- Click Change Password. The new password takes effect immediately.
Renaming a user
To rename a PostgreSQL user, follow these steps:
-
Log in to cPanel.
Note
If you do not know how to log in to your cPanel account, please see this article.
-
Open the PostgreSQL Databases tool:
-
If you are using the Jupiter theme, on the Tools page, in the Databases section, click PostgreSQL Databases:
-
If you are using the Paper Lantern theme, in the DATABASES section of the cPanel home page, click PostgreSQL Databases:
-
Under Current Users, locate the user that you want to rename, and then click Rename.
-
In the text box, type the new name, and then click Proceed.
-
In the Password and Password (Again) text boxes, type the password for the user, and then click Change Password.
Tip
You can use the same password—you do not have to specify a new password.
- Click OK. cPanel renames the user.
Deleting a user
To delete a PostgreSQL user account, follow these steps:
-
Log in to cPanel.
Note
If you do not know how to log in to your cPanel account, please see this article.
-
Open the PostgreSQL Databases tool:
-
If you are using the Jupiter theme, on the Tools page, in the Databases section, click PostgreSQL Databases:
-
If you are using the Paper Lantern theme, in the DATABASES section of the cPanel home page, click PostgreSQL Databases:
-
Under Current Users, locate the user that you want to delete, and then click Delete.
-
Click Remove User 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
To create a PostgreSQL database, follow these steps:
-
Log in to cPanel.
Note
If you do not know how to log in to your cPanel account, please see this article.
-
Open the PostgreSQL Databases tool:
-
If you are using the Jupiter theme, on the Tools page, in the Databases section, click PostgreSQL Databases:
-
If you are using the Paper Lantern theme, in the DATABASES section of the cPanel home page, click PostgreSQL Databases:
- Under Create New Database, in the Database Name text box, type the name of the database.
Note
You cannot use capital letters in a PostgreSQL database name.
- Click Create Database.
Note
When you create a database, your username is added to the database name. For example, if your username is username, and you create a database named database, the actual PostgreSQL database name is username_database.
Adding a user to a database
Note
Managing PostgreSQL user permissions can be tricky. You should import all PostgreSQL data as the primary PostgreSQL user (that is, by using your hosting.com account username). If you import PostgreSQL data as a regular user, you will be unable to see or manipulate the data properly using phpPgAdmin. After you have imported the data as the primary PostgreSQL user, you can create a regular database user and grant the user access to the data. Then you do not have to use the primary domain username and password in scripts that access the database.
To add a PostgreSQL user to a database, follow these steps:
-
Log in to cPanel.
Note
If you do not know how to log in to your cPanel account, please see this article.
-
Open the PostgreSQL Databases tool:
-
If you are using the Jupiter theme, on the Tools page, in the Databases section, click PostgreSQL Databases:
-
If you are using the Paper Lantern theme, in the DATABASES section of the cPanel home page, click PostgreSQL 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 Submit.
Removing a user from a database
When you remove a user from a database, the user is no longer able to access the database.
To remove a PostgreSQL user from a database, follow these steps:
-
Log in to cPanel.
Note
If you do not know how to log in to your cPanel account, please see this article.
-
Open the PostgreSQL Databases tool:
-
If you are using the Jupiter theme, on the Tools page, in the Databases section, click PostgreSQL Databases:
-
If you are using the Paper Lantern theme, in the DATABASES section of the cPanel home page, click PostgreSQL Databases:
-
Under Current Databases, locate the user that you want to remove, and then click the trash can
icon.
-
Click Delete User from Database. cPanel removes the user from the database.
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.
Note
When you delete a database, its associated users are not deleted. However, all permissions that users have for that database are deleted.
To delete a PostgreSQL database, follow these steps:
-
Log in to cPanel.
Note
If you do not know how to log in to your cPanel account, please see this article.
-
Open the PostgreSQL Databases tool:
-
If you are using the Jupiter theme, on the Tools page, in the Databases section, click PostgreSQL Databases:
-
If you are using the Paper Lantern theme, in the DATABASES section of the cPanel home page, click PostgreSQL Databases:
-
Under Current Databases, locate the database that you want to delete, and then click Delete.
-
Click Delete Database. cPanel deletes the database.
More Information
For more information about PostgreSQL, please visit http://www.postgresql.org.
Related Articles
Updated 1 day ago