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
rs.FindFirst not woking in Access 2007
Burning DVD's
The paste image turn to black on Microsoft Word
Resx Language Problem
acer aspire am5640...darn sound!!!
Update visible fields in Active Directory Users and Computers
VB.NET 2008 Dynamically Add Forms Controls Based on Directories and Files
Sharepoint HostHeader Web site and Office Web Applications not working correctly
Server with SBS 2003 retrive pop3 mail faster.
edit excel object embedded in PowerPoint via PowerPoint macro