Breaking News
Home / Sys Admin / Mysql / How to find out MySQL database hostname in Godaddy Shared Hosting?

How to find out MySQL database hostname in Godaddy Shared Hosting?

Locating Your Godady Database’s Host

Do not use “localhost” as the hostname for your database-driven websites on shared hosting accout. Once you have successfully created a database, your host name displays on the Database Information page of your hosting Control Panel.
To Find the Host Name for Your Database
  1. Log in to your Account Manager.
  2. Click Web Hosting.
  3. Next to the hosting account you want to use, click Launch.
  4. In the Databases section of the hosting Control Panel, click MySQL or MSSQL depending on the database type for which you want the host name.
  5. From your list of databases, click Actions next to the database you want to use, and then click Details.

Your database host name displays in the Hostname field.

Then you can configure your scripts and connect to the database as needed.<!>

This is how it looks

Godaddy Database Details

 

For Example

define (“DBASE_HOST”,”go daddy hostname”);

define (“DBASE_USERNAME”,”admin”); 
define (“DBASE_PASSWORD”,”your pasword”); 
define (“DBASE_NAME”,”your database name”);

function open_dbase()
{

  // connect to the mysql server
  $link=mysql_connect(DBASE_HOST,DBASE_USERNAME,DBASE_PASSWORD);

  if (!$link) {
    die(‘Could not connect: ‘ . mysql_error());
   }

  // select the database
  mysql_select_db(DBASE_NAME);
  return $link;
}

function close_dbase($link)
{
 
  mysql_close($link);
}

[pb_builder]

Check Also

Compare On-Disk v/s In-Memory Databases

We all know and have used regular databases like Oracle, Mysql etc.. These are what …

Advertisment ad adsense adlogger