If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Trouble Connecting to MySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-14-04, 17:03
timbr8ks timbr8ks is offline
Registered User
 
Join Date: May 2004
Posts: 2
Trouble Connecting to MySQL

So, I just got a new computer (excellent), but I cannot connect to MySQL via my PHP pages.

Running Windows XP Pro, I've installed IIS and MySQL 4. I can connect to the database from the Command line, and PHPMyAdmin works fine. But when I try to run this code from PHP:

PHP Code:
$link mysql_connect('localhost''gareth''[password]') or die("Could not connect");
mysql_select_db('test'); 
I get this result:

Warning: mysql_connect(): Access denied for user: 'gareth@localhost' (Using password: YES) in c:\inetpub\wwwroot\tbrooks\TMP2j9oqxq230.php on line 7
Could not connect

I've checked everything. Running WinMySQLAdmin, I can see that I have the user and password right. Can anyone offer any suggestions?
Reply With Quote
  #2 (permalink)  
Old 05-14-04, 17:12
richy240 richy240 is offline
Registered User
 
Join Date: Sep 2003
Posts: 24
Dude, what is this?!? IIS can run PHP?!?

If so, this changes everything!

I don't know a fix for your problem, by the way. Sorry.
Reply With Quote
  #3 (permalink)  
Old 05-14-04, 21:09
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
Have you tried password without the square brackets?
Does the user gareth have permissions to access the database?
Reply With Quote
  #4 (permalink)  
Old 05-14-04, 21:15
archspeed archspeed is offline
Registered User
 
Join Date: May 2004
Location: Northern California
Posts: 10
looks like you didn't grant your user the proper privileges to access the db
__________________
Tuan M. -- Database Developer Newbie, dot NET generation
If you want cheap-shit web hosting, check out www.websaic.com
For all your custom test socket needs, check out Gold Technologies, Inc.
Oh yeah, last but not least, GO BAR-Honda!
Reply With Quote
  #5 (permalink)  
Old 05-14-04, 21:16
archspeed archspeed is offline
Registered User
 
Join Date: May 2004
Location: Northern California
Posts: 10
whoop, guelphdad got there first hehe.
__________________
Tuan M. -- Database Developer Newbie, dot NET generation
If you want cheap-shit web hosting, check out www.websaic.com
For all your custom test socket needs, check out Gold Technologies, Inc.
Oh yeah, last but not least, GO BAR-Honda!
Reply With Quote
  #6 (permalink)  
Old 05-15-04, 18:13
timbr8ks timbr8ks is offline
Registered User
 
Join Date: May 2004
Posts: 2
That's just it. Gareth *is* the user who's been set up. When I run winmysqladmin, gareth is identified as the user.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On