PDA

View Full Version : mysql connect problems


JohnsonW
07-29-2006, 12:03 AM
From the cmd prompt, I can get into mysql using the "root" user and when I use phpmyadmin, everything seems to work OK.

When I enter this in DW8, I get the something's wrong error:

<?php
$connect = mysql_connect ("localhost", "host", "fakepw") or die ("something's wrong");
?>

I can also enter this and get the error:

<?php
mysql_ping (link_id) or die ("something's wrong");
?>

What am I missing? I know I am just starting to learn PHP & mysql, but shouldn't this work?

Creative Insanity
07-29-2006, 08:23 PM
Make sure that your database user has a password. Without a password you cannot do much at all. Just check that you have a password asigned to root user and that is very easy in command like:

set password for "root"@"localhost" = PASSWORD('password');