How do I prepare a database for my website?

how to obtain your database name, MySQL username and password, and database host …

If your website uses a content management system (CMS) you will likely need to make a MySQL database for the website to use on the hosting server. There may be other reasons that a website would need a database but content management systems such as WordPress, Joomla, or Drupal are the most common examples of a website that would need a MySQL database.
In order for a website to connect to its database it will need at least 4 pieces of information; database name, MySQL username, MySQL user password, and database host. Here is how to set up a new MySQL database and obtain the information you will need with Zenutech web hosting:

1- First log in to the Zenutech Control Panel using your login information found in your “Welcome to Zenutech” email that you had received when your account was first set up. Your login information can also be obtained here if you can’t find it.

2- Go to ‘Web Development‘ and then ‘MySQL

3- To obtain the database name, click the ‘Databasestab and create a new database. The database name includes the prefix starting with ‘db‘ as well as the name you gave it; together the prefix and the name you entered will form the MySQL database name

4- In order to connect to a MySQL database, your website must authenticate to MySQL as a valid MySQL user. To create a new MySQL user go to the ‘Userstab. The MySQL username also will contain a prefix starting with ‘us‘ as well as the name you gave it; together the prefix and the name you entered will form the MySQL username. A MySQL user must have a password; this password should ideally be a strong random password since it will be used for your website to connect to MySQL; it is not a password you will need to use often. This will be the MySQL user password that your website will use to authenticate with MySQL and establish a database connection.

5- The database host is localhost

6- Now that you have the MySQL database name, the MySQL username, the MySQL user password, and the database host, there is only one final step. In order for the MySQL user that you created to be allowed to access your new database, it will be need to be granted permssions. In the ‘Userstab, click DB Permissions next to the MySQL username that you created. You will be able to see the various database commands that a MySQL user can use as well as each of your databases that you have created. In general, you only want to grant access/permissions that you need to have and no more. In order to keep your websites more secure, we recommend that each website you host have its own database and MySQL user which is only permitted to access its one database and not any of your other databases.
Check off each of the check boxes for your new database and not for the other databases you might have (advanced users may want to only grant certain commands to a MySQL user to keep things even more secure)

If you are looking to make manual changes to your database or to import a .sql file into a new database, you can use phpMyAdmin which is available in the ‘Web Development‘ menu. To log into phpMyAdmin, you enter the MySQL username and its password that you set up in the control panel. Once logged in, you should be able to select your database from the drop down box in the top left corner. If there is no database in the drop down box, then you probably forgot to grant database permissions for that database to the MySQL user you are logged in as.

Posted 2012-03-19 in Account Management