database connection |
database connection |
minidiapolis |
Oct 4 2011, 01:36 PM
Post
#1
|
Serious Coder Group: Members Posts: 437 Joined: 3-September 06 Member No.: 57 |
what 's wrong with the following code ?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $host = "localhost"; $username = "ZXXics"; $password = "XXXXXX711"; $connection = mysql_connect($host,$username,$password) or die("connection could not be established"); ?> </body> </html> I'm getting this error Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in D:\Hosting\5246561\html\treats.php on line 14 connection could not be established |
Darin McGrew |
Oct 4 2011, 02:33 PM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Perhaps this will help:
http://dev.mysql.com/doc/refman/5.5/en/can...-to-server.html |
Frederiek |
Oct 5 2011, 01:57 AM
Post
#3
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
|
Christian J |
Oct 5 2011, 08:14 AM
Post
#4
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
In some cases it seems the user name must be "root".
|
Lo-Fi Version | Time is now: 23rd April 2024 - 01:50 AM |