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
Error 3709 in ASP application
WSS 3.0 back to original
Access - Creating new field contents from several other fields
How do I change this JavaScript so it returns only one correct input and not two as it does now?
Stop ie7 asking to upgrade to ie 8 on XP SP3
Tomcat Webapps Read File
How to copy the XLSX file to XLS file using C#
Vodafone Mobile Connect Error Code 619
asp.net Need to know to reset a form. once it has been submited. My form is retaining it values.
Switch audio from one application to separate audio device?