Managing MySQL or PostgreSQL databases in cpanel

    The article was added by Mihai T. at 09/28/2008.

  Submit | About | Contact & Privacy Policy

You are here: Articles Directory » Web Hosting

Bookmark and Share

Clicking on the MySQL or PostgreSQL icons on the main cPanel screen will allow you to create or work with those types of databases. The interfaces that cPanel uses for both types of databases are remarkably similar and since most hosts only offer MySQL, we will focus on that (noting where the PostgreSQL interface differs from the one for MySQL).

databeses in cpanel

There are four main sections to the MySQL/PostgreSQL cPanel screen (referred to as the database screen from now on). The first section allows you to create and work with the databases themselves. The section below that allows you to create users that will be able to access one or more databases. Next, if your web host permits, you can set up remote access to your databases. Finally, there is a link to phpMyAdmin or phpPgAdmin, web interfaces for advanced work with your databases.

There are four main sections to the MySQL/PostgreSQL cPanel screen (referred to as the database screen from now on). The first section allows you to create and work with the databases themselves. The section below that allows you to create users that will be able to access one or more databases. Next, if your web host permits, you can set up remote access to your databases. Finally, there is a link to phpMyAdmin or phpPgAdmin, web interfaces for advanced work with your databases.

Creating a Database

Creating databases and users is easy but not the most intuitive process. The first thing you need to do to create a database is actually the last item in the database section. Type the name of the database into the Db: field and then click on the Add Db button. A database will be created and its name will be displayed at the top of the page. The actual name of the database will be slightly different from the one you choose. The database will be created with your cPanel username and an underscore character added to the beginning of the name you chose when you created the database, for example, domain_mydatabase.

Creating a Database User

Creating a database just creates an empty shell, waiting for data. Before you can use the database, you will need to put at least one user into the database. To create a new user, you need to type a username and password into the user section of the database screen and then click Add User. This will create a user with the password you define. Never leave the password field blank. The database username will be your cPanel username followed by an underscore and then the username you chose. For example, domain_jeff

Adding a User to a Database

You aren't done yet. You now have to associate at least one user with a database. Just above the Add Db field is a set of drop-down lists. The first of these allows you to select a user that you have already created and the second allows you to select the database that you want to associate with that user. Click Add User to Db and you are done. You can add a single user to multiple databases if you want to.

Once you add a user to the database you've created, you will notice that the listing for that database gets more detailed. It will show you the database name followed by some links to delete or repair the database and then it will show you every user in that database, along with sample code that shows you how to connect to the database in a PHP, Perl, or JDBC script (JDBC is only listed if your web host offers Java support).

Removing or Repairing a Database

Next to the username is a button marked Delete, but this can be deceiving because deleting a user from a database only removes the user from that database (and any records the user had in that database); it doesn't affect the actual user you created, which can still be active in other databases. Also, there is a Check button that allows you to check that database for problems, and then click Repair if it reports errors. If that doesn't do the trick, contact your web host for support.

Web Hosting Disclaimer

  • The ArticleCity.info articles directory team is not responsible for falsehoods, inaccuracies, or any other types of misinformation this article may contain and will not be liable for any damage or loss suffered by a user through the user's reliance on the information gained here.
  • ArticleCity.info articles directory is not responsible for any and all copyright infringements by writers and authors. If you suspect the information contained by this page for any copyright infringements, please contact us and we'll investigate the specific article(s) and we will remove the copyrighted material.
Other Web Hosting articles
Understanding how networks work on a basic level - The Basics of Networks Understanding how networks work on a basic level is fairly simple but can quickly become complicated. This is especially true if you are unfamiliar how the technology within different networks functions. From a mecha...
There are many roles that a server can occupy - There are many roles that a server can occupy. For each one there is a unifying similarity: they have to be on a network and have other computers connect to them. In addition to that, these connecting computers have to request something that the s...
Customer Service Leading the Way in Technology - Just the mere mention of the word “internet” can sometimes be very intimidating to people. It's been known to give off the impression that it's to highly technical and confusing for any of us to understand. Unless we've had years of experience, or...
Web hosting requirements at a hosting company - What are the Company's Hosting Policies? Amid all of the marketing material on your potential host's website there is usually some fine print (or worse yet, some things aren't even mentioned publicly) concerning the rules they impose ...
cPanel web hosting account explained - Getting Started with cPanel Now that you have a shiny new cPanel web hosting account, it is time to learn the ropes of cPanel's interface. However, b...
cPanel Interface and general hosting account information - The Main cPanel Interface If you have successfully logged into your account, you should be presented with the main cPanel interface, shown below: ...
cPanel and its general server information explained - General Server Information This is followed by information about the server your account is on: Operating System: This is the operating system that the server your account is on is running. Probably this will be Linux. ...
FTP accounts in your cPanel web hosting account - FTP and cPanel's File Manager It is most likely that one of the first things you will want to do after getting your web hosting account, and taking...
Creating and Managing FTP Accounts under cPanel - Creating and Managing FTP Accounts in cPanel Depending on your hosting plan, you may not be limited to just a single main FTP account. Why would you need more than one? You probably don't if you are the only person wh...
cPanel File manager and File permissions - cPanel's File Manager FTP is not the only way to manage files and directories in your hosting account. cPanel includes a File Manager that will allow you to do almost anything you can via FTP (and a number of things t...