Using Databases Overview
Many websites use databases and scripting languages such as PHP, ASP, and ASP.NET to create dynamic sites and manage large amounts of information, rather than using only static HTML files. Two of the most popular databases are MySQL and MS SQL. Whether you are creating a website from scratch by coding it yourself or are installing one of the many scripts and web applications available, you probably need to interact with a database at some point, even if it is just to set it up.
Unless you are a programmer, you typically will only need to create a database and configure your script to connect to it, and you are done! But more advanced functionality is available for programmers on occasions where you need additional access.
This article will give you an overview of what things may need to be done to use a database and links to the relevant articles that discuss those topics more in-depth, which also give step-by-step instructions.
- This article mentions cPanel and Plesk. If you purchased Shared, Reseller, VPS, or Dedicated hosting, cPanel is available.
- If you have Windows hosting (shared or dedicated), you have Plesk.
- MySQL is available on Linux and Windows hosting, and MSSQL is only available on Windows Hosting.
Please click the links below for the different database functions and the list of articles you can refer to.
- Creating a Database via phpMyAdmin ↴
- Connecting Your Script to the Database via phpMyAdmin ↴
- Connecting to the Database Remotely ↴
- Import and Exporting Database Data ↴
- Creating and Restoring Database Backups ↴
- Managing Your Database via phpMyAdmin ↴
Creating a Database via phpMyAdmin
One thing that you may have to do is create a database. This is required when installing a script that requires a database, like a content management system (CMS), a shopping cart, forum software, or some other web application.
How you create a database will depend on what type of web hosting plan you have. The type of database you create will depend on the script you are installing requirements.
Some scripts will create the database for you, and others will require that you create the database. If your script or project requires you to create a database, please visit the articles listed for step-by-step instructions.
- How To Create or Delete a MySQL Database or User
- How To Create Databases - Plesk
- How to Create a New MySQL Database and User (video tutorial)
- How To Create a MySQL Database in cPanel (video tutorial)
- Creating Databases (Advanced)
Connecting Your Script to the Database via phpMyAdmin
After creating the database, you will need to connect the database to your script. Some scripts will configure this for you; others will require that you edit a configuration file.
The following articles may help you connect your script to your database:
Connecting to the Database Remotely
If you are developing your script or website on your computer, you may want to use an application to manage the database. Some web development software, such as Dreamweaver, also can manage databases remotely. There is a wide variety of software available for this purpose, and they all have varying features and prices. Some are free, and some can be quite expensive. It all depends on the features and functionality you desire.
For this, you will need to do four things. You may refer to the articles provided below for more information.
- Create and set up your database (if you have not already).
- Download an application you want to use to remotely access the database (if you don't have one already).
- Whitelist your IP so that you can access the database remotely.
- Configure your software to connect to the database.
This article has useful information on connecting to your database remotely and by using applications.
To whitelist your IP to connect to your database, you may refer to these articles.
Import and Exporting Database Data
Sometimes you will need to import and export data from a database. This is useful for a number of reasons.
- It is one way to create a backup and restore the database
- It makes it easy to transfer a database from one place to another.
- Some scripts give you a database file that you can import to set up the database and import the required data.
These articles will help you import and export data.
- How to import your MySQL database
- Exporting a MySQL Database via phpMyAdmin
- How to Import MSSQL Database - Windows Shared
- How to Copy a Database in phpMyAdmin
- How to Rename a Database in phpMyAdmin
- Exporting and Importing Databases (Advanced)
Creating and Restoring Database Backups
It is highly recommended that you make periodic backups of your databases, especially before making any changes to them. Here are guides on how to restore and generate backups of your databases.
- Exporting a MySQL Database via phpMyAdmin
- How to import your MySQL database
- How to Import MSSQL Database - Windows Shared
- How to Import MSSQL Database - Windows Shared
- How to Back Up a Database - Plesk
- Backing Up and Restoring Data (Advanced)
Managing Your Database via phpMyAdmin
Here are some additional tasks you may want or need to do with your database via phpMyAdmin.
- How To Repair a Broken Database
- How To Optimize a MySQL Database
- How To Copy a Database in phpMyAdmin
- How To Rename a Database in phpMyAdmin
- How To Access phpMyAdmin from cPanel
- How To Merge Two MySQL Databases
- How To Allow Other cPanel To Connect To Reseller cPanel Database
- Dropping Columns from Database in phpMyAdmin
- MySQL Database Search in phpMyAdmin
- How To Drop Tables From a Database in phpMyAdmin
- How To Add Tables to a Database in phpMyAdmin
- Adding a Column to a Database Table in phpMyAdmin
- How To Run SQL Queries in phpMyAdmin
- Modifying Table Columns in phpMyAdmin
- Whitelist Your IP in cPanel for Remote MySQL Access
- How To Maintain Database Tables With phpMyAdmin
- How To Troubleshoot Common Database Errors