Account Manager
 

Setting Up a MySQL Database

Log into your Control panel and click on the MySQL Database link.



Enter a name for your database where it says New Database:

Click on Create Database. The database will be created.

Your hosting account's username will be appended to the beginning of the database name you created. So if you named your database "Test" the server would append your username which is the first 8 letters of your domain name in front of _Test. So, for example, the Test database for yourdomain.com would be named: yourdoma_Test.

We will now need to create a user that has access to this database.

Below the section that says Current Users, you will see two text boxes Username and Password. Enter a username and a password. For this example, we entered a Username of testuser and a Password of test.

The username will again get the account's username appended to the beginning of it. So the actual username to use in a script would be yourdoma _testuser

You will notice that the drop down boxes under Users in yourdoma_Test have changed. There is now a user listed beside User. You will need to select a username and the corresponding database you want this user to have access to. Since there is only one database and one username created for this example, they are selected by default. Clicking on Add User to Database will add this user to the database.

In summary, the information you would use to access the database in this example is:

Database Name: yourdoma_Test
Username: yourdoma_testuser
Password:test

If you are running a script on the server that requires a MySQL database, the server or servername to use is probably localhost. This is assuming that the script resides on the server and is accessing the MySQL server that is on the same server.

You can create additional usernames to access the same database. Each user will need to be added to the database, however. The username of the account is appended to the database name and username, to prevent overlapping, in case another user creates the same database name or same username.

For more information about setting up MySQL Databases, please check this database and our tutorials.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
An Overview of MySQL (Views: 361)

Powered by WHMCompleteSolution