To create the database, do the following:
- Log into the cpanel
- Click the MySQL Databases icon under the "Databases" category
- Create a New Database (make it short best result)
- Add New User (make it short best result)
- Most importantly, select the user and database underneath "Add User To Database" and click "Add" (authentication will not work if you do not click this button).
After doing all these steps, you can create the database tables either via phpMyAdmin or use an online PHP or Perl script.
The username format will be: username_dbusername
The database format will be: username_dbname
The hostaddress will be: localhost
For example, if you enter the following variables:
You will end up with the following format that you would place in your connection string
Notice the password remains the same format.
The connection string can be either of any examples below:
For example, we will use the above example variables:
$dbh = DBI->connect("DBI:mysql:username_db01:localhost","username_admin","password");
$dbh=mysql_connect ("localhost", "username_admin", "password") or die ('I cannot connect to the database.');
To create tables and other functions, you can use the PHPMyAdmin located in the Databases section of the cPanel. For more information on how to work with PHPMyAdmin. please visit: phpmyadmin.net