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
uid to principal_id
PL/SQL: ORA-00917:missing comma
Need help in updating a SQL query to retrieve multiple data from a signle column
conditional statement help. php
Citrix: Pre-configure Internet Explorer browser settings for the users
How to clean up the unnecessary code generated by DW
Outlook 2007 - "Message store has reached its maximum size..." (0x8004060C)
Computers dropping off the network
Entries with Commas Not Generating Value in IE/Javascript
Issue with Exchange 2010 GAL