Cannot gain access to phpmyadmin. Help please.

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
footyboy87
Forum Newbie
Posts: 2
Joined: Sun Apr 18, 2010 2:27 pm

Cannot gain access to phpmyadmin. Help please.

Post by footyboy87 »

The code is below the effor. It is also linked to another PHP file in Dreamweaver which allows users to subscribe/unsub from an email service.
I keep getting;

"Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'aidan1'@'localhost' (using password: YES) in C:\Users\aidan\Desktop\3RD YEAR!!\Steve Pressland\server2go_a2\htdocs\Home_Fundraising\random.php on line 7
Connect failed: Access denied for user 'aidan1'@'localhost' (using password: YES) "

Code: Select all

<?php

	function doDB() {
		global $mysqli;
		
		//connect to server and select database; you may need it
		$mysqli = mysqli_connect("localhost","aidan1","password","hhh");
		
		
		//if connection fails, stop script execution
		if (mysqli_connect_errno()) 
		{
			printf("Connect failed: %s\n", mysqli_connect_error());
			exit();
		}
	}

function emailChecker($email) {
	global $mysqli, $check_res;
	
	//check that the email is not already in list
	$check_sql - "SELECT id FROM SUBSCRIBERS 
	WHERE email = '".$email."'";
	$check_res = mysqli_query($mysqli, $check_sql)
		or die(mysqli_error($mysqli));
		}
?>
Thanks in advance!
Last edited by Benjamin on Tue Apr 20, 2010 3:51 am, edited 1 time in total.
Reason: Added [syntax=php] tags.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Cannot gain access to phpmyadmin. Help please.

Post by Christopher »

Either the username and/or password is wrong, or you have not granted access to that user for that database.
(#10850)
footyboy87
Forum Newbie
Posts: 2
Joined: Sun Apr 18, 2010 2:27 pm

Re: Cannot gain access to phpmyadmin. Help please.

Post by footyboy87 »

That isn't the case as all everything is granted to that user and the password/username are fine. any ideas guys??
Post Reply