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
Add a child class to a domain service POCO in Silverlight RIA
Need to build a messaging mail box.
Java 6 update 20 deployment with GFI languard, switches used?
Transfert in Microsoft access db
How purge records from access database
How to test if a control has data
Do I really need 3 form.php files plus 3 send_form.php files?
Windows 7 Password Protection Issue
Outlook 2003 - How Do I Set MS Exchange Server...
format control based on passing form and control name