access denied

This is a discussion on "access denied" within the PHP Forum section. This forum, and the thread "access denied are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Aug 2nd, 2005, 23:41
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
access denied

im just starting to get to grips with mysql using php.

i set up my first database not long ago, and i tried to connect to it using the following:

Code: Select all
<?php
// Connecting, selecting database
$dbh=mysql_connect ("localhost", "tuggersc_gavtest", "<tuggers_gavtest>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("tuggersc_gavssqltest"); 
// Performing SQL query
$query = 'SELECT * FROM my_table';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());

// Printing results in HTML
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
   echo "\t<tr>\n";
   foreach ($line as $col_value) {
       echo "\t\t<td>$col_value</td>\n";
   }
   echo "\t</tr>\n";
}
echo "</table>\n";

// Free resultset
mysql_free_result($result);

// Closing connection
mysql_close($link);
?>
following this tutorial from php.net http://www.php.net/manual/en/ref.mysql.php(bout 30% down.)
but it says when i try to view the file

Warning: mysql_connect(): Access denied for user: 'tuggersc_gavtest@localhost' (Using password: YES) in /home/tuggersc/public_html/fantasy-league-test/mysql_test/test.php on line 11
I cannot connect to the database because: Access denied for user: 'tuggersc_gavtest@localhost' (Using password: YES)

the location is http://www.tuggers.co.uk/fantasy-lea..._test/test.php

cheers all
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Aug 3rd, 2005, 09:10
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,191
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
This really does look like you've got something wrong.

Double check the server name, database name, username and password.
I'm fairly sure something isnt quiet right there looking at the error message
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Aug 3rd, 2005, 14:14
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
the connection string was copied from cpanel, so i would guess that it was correct....

i havnt changed anything on it. except putting the password in. what could it be...?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Aug 3rd, 2005, 21:04
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
That exact same code works fine here.

You must be using either the incorrect servername, username, password or perhaps you're trying to access a table that you don't have rights to access. Check all these things again.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Aug 3rd, 2005, 21:06
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
i dont think ive set up a table yet, would that be why? i just set up the database stright from cpanel u see. so i dont know if there would be a table already made......
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Aug 4th, 2005, 10:57
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
If the table didn't exist, you would get a different error with details of the table that could not be accessed.

There must be a problem with either the hostname, database name or password.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Aug 4th, 2005, 18:45
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
ive checked the username and password, and they are fine. so it must be sothing to do with the host name. i have it at local host, which was the example i used. but what is an example of a hostname. its on a web host at zmb.co.uk

im stumped lol
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Aug 4th, 2005, 23:08
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
It's usually localhost, but some hosts choose to have a seperate mysql server... they should tell you this!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Aug 4th, 2005, 23:13
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
ive flagged a post on the admin support section. ill see what they have to say and get back to u
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Aug 11th, 2005, 03:16
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 26
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Any luck?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Aug 19th, 2005, 11:01
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
have i eck

i wsubmitted a ticket and then somthing went wrong with the ticket section of the site. theres no a box that says Unauthorized Version Installed and a box to enter a lisence code.

so ive been waiting for them to fix that.

but now ive had enough!
lol
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
access, denied

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] HELP!! Frame source &quot;access denied&quot; kevinkan JavaScript Forum 8 Oct 3rd, 2007 08:28
ASP Multi users Access to Microsoft Access ish Classic ASP 0 Apr 26th, 2007 20:05
Access Denied Problem EdwardA Databases 3 Dec 27th, 2006 22:51
Permission Denied '800a0046' - but why? simoncpage Classic ASP 3 Jan 30th, 2006 15:13
Image copy denied LadyT Graphics and 3D 7 May 7th, 2005 10:26


All times are GMT. The time now is 20:36.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42