I'm trying to roll a CMS website and I'm on 1and1 Internet's hosting. I'm trying to connect to my MySQL database and I get the following error:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
After some frustration, I decided to check my include and it turns out that the following code is not including my connection variables file.
admin.php
<?php
include("connection.php");
$link = mysql_connect($connection_server, $connection_user, $connection_password);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
connection.php
<?php
/* --------------------------------------
/
/ Bitachon.org Connection Variables
/
/ Created by: Moshe [Last Name]
/
/
/ Date: October 12, 2010
/
/
/ This file contains the connection
/ variable to connect to the MySQL
/ database that powers [site]
/
/ --------------------------------------*/
//Variable to confirm that the file has been included
$connnections_included = true;
/* --- Connection Variables ---*/
$connnection_server = "[server]";
$connection_database = "[db]";
$connection_user = "[username]";
$connection_password = "[password]";
?>
What's wrong?