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
Excel. Disable "Do you want to save a shared version of this workbook?"
Conver a VMDK to native installation ISO file
Asp.Net Conversion failed when converting from a character string to uniqueidentifier.
Multithreading in C# .NET
Measuring distance with wireless
I need to create stored procedure to show sent messages.
Temp Table or DataTable
Java script and Div tag
connecting to outlook 2003 from SBS 2003 without joining the domain
Low battery warning on battery that is fully charged - Why do i get that message