Jump to content

Basic user registration code - accessing database (access denied for..)


JohnSmithers

Recommended Posts

My first post in here. The issue is when I try to access my database online I get the following messages:

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'Harry'@'localhost' (using password: YES) in /data/www/vhosts/liminalradio.mobi/httpdocs/signupbasic.php on line 115

 

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /data/www/vhosts/liminalradio.mobi/httpdocs/signupbasic.php on line 117

Could not connect: Access denied for user 'Harry'@'localhost' (using password: YES)

 

(note - I also ran an alternative piece of code earlier that appeared to add user details to the database, but it wasn’t there when I looked; hence the reason I changed it for my old code that I knew worked).

 

In phpmyadmin, "Harry" is the only name that has access to the database and the password has been double-checked.

 

Is it my code or my server?

 

=======================================

My code:

==========================================

 

//connects to database

 

$name = ($_post['username']);

$password = ($_post['password']);

$email = ($_post['emailaddress']);

$awareness = ($_post['awareness']);

 

if(isset($_POST['submitok']))

{

//$dbhost = 'localhost';

//$dbuser = 'Harry';

//$dbpass = 'x67sfd';

//$dbname = 'CloudenRoad';

//$table = 'supporters';

 

$conn = mysql_connect('localhost','Harry', 'x67sfd');

 

mysql_select_db($dbname, $conn);

 

if (!$conn)

  {

  die('Could not connect: ' . mysql_error());

  }

echo "it works again";

 

Link to comment
Share on other sites

Yes. 100% (confirmed).

 

:-(

 

Just in case - was going to check this one out later - when I first logged in to phpmyadmin I placed a random selection of letters for my blowfish secret; I've still to read up on this (to refresh me from Welling and Thomson) but is that a threat to my long-term control of the database? Will it make any difference in this case?

 

Ignorant, but fast learner; but willing to learn hard !

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.