How do I connect to a database?
Posted by Joe Rebis (Import) on 16 September 2006 09:34 PM
This topic refers to connecting your website application/software to a database you've already created. Please refer to the Create Database or Manage Database (SQL / MySQL / MSAccess) topics for your particular database for additional information. Also refer to the help section for Data Source Names.
The instructions to connect to the database for your particular website may vary but they are all essentially the same. There are two overall ways this may be done and depend on your website configuration. See the instructions, speak with your web developer or reach out to our support department.
This is the most common way for most websites. Your website will have a configuration file. In it you will need to specify the IP address (or "localhost") to the database, the database name, the username and the password. To find the configuration file you will need to read the instructions for your application. To find the IP address see below.
Data Source Name (DSN) / ODBC Connection:
In this configuration you create a name to refer to your connection and then reference that name in your website's configuration file. If an ODBC connection the data source name can be created in the control panel using the same details as the direct connection. Otherwise, if using ColdFusion pleased reaching out to our support department with the type of database, the name of the database and your username and password.
Finding the IP address to your database:
Linux Web Hosting Plans:
Use "localhost" when connecting to the database from your website. Click or search for the PHPMyAdmin link to modify your database.
Windows Web Hosting Plans:
You will need to use the IP address instead of "localhost". The IP address can be found by clicking on the database.
Use the internal IP address (192.168.XXX.XXX) when connecting to the database from your website.
If you are still having issues, please contact us for further help.