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 > Data Access, Manipulation & Batch Languages > PHP > Access Denied - connecting to mysql using PHPmyadmin

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-11, 18:39
cecilia81 cecilia81 is offline
Registered User
 
Join Date: Nov 2011
Posts: 5
Red face Access Denied - connecting to mysql using PHPmyadmin

Not sure if this is the right place to post this, but yea.

The error I got is
HTML Code:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in /Applications/XAMPP/xamppfiles/htdocs/helloworld.php on line 2
Access denied for user 'root'@'localhost' (using password: YES)

My PHP script is
PHP Code:
<?php
mysql_connect
("localhost""root""password") or die(mysql_error());
echo 
"Connected to MySQL<br />";
mysql_select_db("helloworlddatabase") or die(mysql_error());
echo 
"Connected to Database";
?>

Attached is what i have on PHPMyadmin > user privileges tab.
I have created another user "thian" which also has global privilege to this helloworlddatabase, and the same error pops up.

Please tell me what is wrong here...
Attached Thumbnails
Access Denied - connecting to mysql using PHPmyadmin-picture-2.png  
Reply With Quote
  #2 (permalink)  
Old 11-19-11, 18:44
cecilia81 cecilia81 is offline
Registered User
 
Join Date: Nov 2011
Posts: 5
oOPS, this is resolved...
Up to databases instead of helloworlddatabase, and the user's privilege tab shows password : no. So I edited my PHP script and make it without password then voila!
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