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
Secondary BIND can't get update from primary
downloading image in asp.net vb
How to graph a fixed line vs individual days data in Excel
How do I insert li into ul based on an attribute?
Bind9 error query cache
Anchor link not working in Firefox on asp page
How to print from a terminal server to a local network printer
asp.net Can I put more that one mssql table 'field' in one GridView Column?
Ethernet Tap
NAT Watchguard question two exchange servers, mail not going out.