Jump to content

mysql connect problems


Recommended Posts

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");
?>

I believe everything is set correctly according to phpinfo.  What am I missing?

My setup is using Apache2triad that uses
Apache 2.2.0
MySQL 5.0.11
PHP 5.1.2
Link to comment
Share on other sites

Try this:
[code]$connect = mysql_connect ("localhost", "host", "fakepw") or die ("Unable to connect to the database: " . mysql_error()); [/code]
It should now return an erroir message from mysql this time, which should tell you why it is failing.
Link to comment
Share on other sites

Unable to connect to the database: Access denied for user 'host'@'localhost' (using password: YES)

Thanks, I think I figured this out.  The message above shows the user to be host when it should be root.  I changed to root and got no error message, so assume it is now working.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.