- Copy and paste the below text into a blank text file.
$db = "Database name"; #Database name
$user = "Database username"; #Database username
$pass = "Database password"; #Database password
$host = "Database server"; #Database server
$conn = mysql_connect($host,$user,$pass) or die("could not connect to server " .mysql_error());
mysql_select_db($db) or die("could not connect to database " .mysql_error());
echo ("Database Connected");
- Please see the article Web Hosting - Managing Users for Databases to determine your username and password, and to determine which database server to connect to.
NOTE: We do not allow remote connections to the database server. If you are encountering errors while attempting to use a desktop application to connect to the database, this is probably why.
NOTE: Specifying "localhost" for the database server will not work. Please use the appropriate server name, as specified above.