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
java.util.MissingResourceE
xception in JSP
Jquery simple tooltip - code example, not plugin
IFrame History
4.4.1 AND 4.4.2 SMTP Send Errors
RAM Issue with Dell Dimension 4600
asp.net I have this msql select that is returning an error Incorrect syntax near '.'. I cannot see where its.
Need help removing Worm Autorun.B
this.name in the base class of a windows form
Can not convert a mssql query to a mysql query
The use of Not