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
TV SETUP WITH MULTIPLE INPUTS
Joining Mac OS X Version 10.6.4 to windows server 2008's Active Directory
NDR spam on exchange 2003
want to change what recipient sees when i send a php mail
Nav text resizing when text only zoom is checked in FF
Windows Server 2003 Licensing Questions
Debian Linux apache2
Microsoft Access database on network omits objects when accessed from a specific computer
Changing Field code of current header
SHGetPathFromIDList(IntPtr
, String^); API in VC++.net Not working please tell me where i am wrong