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
What education path should I take?
How do I disable the information bar using group policy
asp.net Can I put more that one mssql table 'field' in one GridView Column?
MySQL - how to create a back up copy of database using InnoDb tables on another Windows machine
VBA RunTime Error 424 Object Required Excel
Sonicwall TZ 190 - Disable public admin login (port 80)
Shadow Protect Image Manger connections problems
Copying a macro from one document to another
Windows 2003 SBS locks up during full scan of Malwarebytes.
How to Download all files using FTP from a VS 2008 VB project