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
BSOD Minidump analysis stop code 19 and BAD_POOL_HEADER
Wireless print server with Windows Server 2003
Function to mark a link as hyper link
Preserve data format in text box in excel03
c# last execution time of a process and kiling the last process of the same application
Create a shortcut or drive letter for a digital camera
Capture bin file from Cisco ASA device
What does "Func<string, int> method = Work;" do?
Boxes not lining up in IE
Need help locating drivers for an Acer Aspire 3620