Microsoft
Software
Hardware
Network
Question : Mysql conncetion problem
I try to connect with below code to Mysql database,
but it says
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket ....
Database is not available. Try again later.
but the code must be correct..
what seems to be the problem
<?php
$con = mysql_connect("localhost",
"xxxxxx","
xxxxxxxxxx
");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// some code
?>
Answer : Mysql conncetion problem
yes syntax is correct:
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'password';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'db_name';
mysql_select_db($dbname);
?>
Random Solutions
Can’t run GUI using ssh –Y
Access 2007 --- Run-time 2455: You entered an expression that has an invalid reference to the property LinkChildFields.
Access - time delivery of a built in macro
Sahi scripting for testing web pages
Access query
Laptop action keys not functioning on debian
How to install CURL on a Dedicated Windows Server
Can you limit the Xfer folder from Symantec Endpoint Protection Client?
Stored Procedure to pass parameter to another SSRS report
Change AD password in OWA