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";

 

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 !

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.