Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Directory Submission Service   I Sell Pagerank   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 08-03-2005, 05:11 PM   #1 (permalink)
Inactive
 
Jshortest's Avatar
 
Join Date: 01-08-04
Posts: 85
iTrader: 0 / 0%
Latest Blog:
None

Jshortest is a jewel in the roughJshortest is a jewel in the roughJshortest is a jewel in the roughJshortest is a jewel in the roughJshortest is a jewel in the roughJshortest is a jewel in the rough
error trying to connect to mysql

I just got started learning mysql and I'm already stuck with an error I get when I try to connect to run a query with php.

The error is
Warning: mysql_connect(): Access denied for user: 'helmet_admin@localhost' (Using password: YES) in /home/helmet/public_html/test.php on line 3
I cannot connect to the database because: Access denied for user: 'helmet_admin@localhost' (Using password: YES)

Code:
<?php $dbh=mysql_connect ("localhost", "helmet_admin", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("helmet_learndb"); ?>
Jshortest is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 08-03-2005, 06:15 PM   #2 (permalink)
v7n Mentor
 
jg_v7n's Avatar
 
Join Date: 08-26-04
Location: Rio de Janeiro
Posts: 1,289
iTrader: 0 / 0%
Latest Blog:
None

jg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web pro
Well, access is denied for user "helmet_admin" at host "localhost".

Either:
1) The user doesn't exist
2) The password is incorrect
3) You have no permissions
jg_v7n is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-03-2005, 07:28 PM   #3 (permalink)
Contributing Member
 
FGTH's Avatar
 
Join Date: 03-06-04
Location: NY, CT, CA, AZ
Posts: 555
iTrader: 0 / 0%
Latest Blog:
None

FGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to allFGTH is a name known to all
Try using the code below.
Code:
// Set the database access information as constants define ('DB_USER', 'helmet_admin'); define ('DB_PASSWORD', 'YOUR_PW'); define ('DB_HOST', 'localhost'); define ('DB_NAME', 'helmet_learndb'); // Make the connection and then select the database. $dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() ); @mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );
If using phpMyAdmin:
1) login with your db admin account
2) click on "Privileges"
3) make sure "helmet_admin" exists
4) Global privileges set to "ALL PRIVILEGES"
5) Grant set to "Yes"

If you've got root access, you should be able to connect to the Db using root and the root password.

I prefer using mySQLCC (mySQL Control Center) since it can be used independent of a browser.

Hope that helps...
__________________
"90% of the game is half mental."
--Yogi Berra
Elizabeth Arden

Last edited by FGTH : 08-03-2005 at 07:34 PM.
FGTH is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to connect mabel01 Computers & Internet 11 10-02-2007 02:08 AM
MySql Error daniel0012 Coding Forum 6 07-01-2007 04:45 PM
Error Message MySql - Please help sovereign6 Coding Forum 7 08-16-2006 12:58 PM
MySQL error... but why? sparkblaze Coding Forum 3 02-15-2006 01:31 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 03:36 PM.
© Copyright 2008 V7 Inc

Click Here