Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

edesignuk

Moderator emeritus
Original poster
Mar 25, 2002
19,232
2
London, England
I setup MySQL under Panther last week, it's installed an working (see attachment 1), I can see it's running, and that databases exist in it. I can even install a forum package like IPB, or vB, and it will connect to the local MySQL Server and install itself and run with no problems.
I also have a couple of PHP files that are part of a tutorial I was running though, this is the code for them:
PHP:
 $user="root";
 $password="???????";
 $database="DEV_DB";
 mysql_connect(localhost,$user,$password);
 @mysql_select_db($database) or die( "Unable to select database");
 $query="CREATE TABLE ITSC_INTRANET (SCROLLER text)";
 mysql_query($query);
 mysql_close();
PHP:
 $user="root";
 $password="???????";
 $database="DEV_DB";
 mysql_connect(localhost,$user,$password);
 @mysql_select_db($database) or die( "Unable to select database");
 $query="INSERT INTO ITSC_INTRANET VALUES ('There are no alerts at present.')";
 mysql_query($query);
 mysql_close();
If I "run" these pages the data is entered into the database, again proof that everything is working properly.

But, I have a site setup in DW MX 2004 as a PHP MySQL site, and when I make a new connection (using the "wizard") I get this error (see attachment 2).

Any idea what's going on here? I know that MySQL is running, and I know it can be accessed. I don't know s*** about MySQL, so I'm totally confused by this.
 

Attachments

  • bdsexist.jpg
    bdsexist.jpg
    23.4 KB · Views: 147
  • dwsqlerror.jpg
    dwsqlerror.jpg
    38 KB · Views: 115
Looks like the URL prefix you entered for the site might not be taking correctly. Are you trying to access from your user folder's site directory or /Library/WebServer/?

PS. You've got a root password showing in plain text in that error message you might want to blur out. ;)
 
Just noticed I'm only on MX here at home (work has MX 2004) so my steps are a bit different than yours. I'll try at work tomorrow to see how it goes, if you haven't already found a solution by then.
 
The key is in that URL - looks like its passing connection information in the query string.

Is your database server listening for requests where hostname=imacg5.ad.home?

Notice the "host=" parameter is passing your machine host name instead of "localhost".

You should verify your machine will answer db requests using the mysql command in Terminal

PHP:
mysql -h imacg5.ad.home -u root -p

If it doesn't answer (ie prompt you for password), there are a couple workarounds like modifying your hosts file - for example.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.