[eluser]Unknown[/eluser]
[quote author="Deno" date="1384328435"]I am having trouble connecting the my database can someone please have a look at my PHP connection string and let me know what I have done wrong? I am new to SQL and PHP so dont move to quick.
This is my connection string:
<?php
$hostname = "localhost:/var/lib/mysql/mysql.sock";
$username = "root";
$password = "Mcdougall70";
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die(mysql_error());
echo "Connected to MySQL, Great work<br>";
?>
This is the message I get:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/62/11316962/html/securetecaustralia/mysql_connect.php on line 7
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Now Line 7 is the $dbhandle = mysql_connect($hostname, $username, $password)[/quote]