• Register
0 votes
5k views

Problem :

I keep getting a below error with mysql connection through a XAMPP and I really don't know what to do:

Mysqli_real_connect(): (hy000/1045): access denied for user 'pma'@'localhost' (using password: no)

I have already reset my password from a MySql from a command line three times and added a changes to my code and to my php.ini file, but at each time it goes back to a error. Any help on this issue?

7 5 2
3,870 points

Please log in or register to answer this question.

2 Answers

0 votes

Solution :

In your terminal, log into the MySQL as root. You may have created the root password when you had installed MySQL for a first time or a password could be blank, in each case you can simply press ENTER when prompted for your password.

 sudo mysql -p -u root

Now add your new MySQL user with a username of your choice. In this example we are reefing it as pmauser (for the phpmyadmin user). Make sure to replace the  password_here with your own. You can now generate a password here. A % symbol here tells the MySQL to allow your user to log in from anywhere remotely. If you wanted to heightened security, you could replace it with the IP address.

CREATE USER 'pmauser'@'%' IDENTIFIED BY 'password_here';

Now we will grant the superuser privilege to your new user.

GRANT ALL PRIVILEGES ON *.* TO 'pmauser'@'%' WITH GRANT OPTION;

Then go to the config.inc.php ( in your ubuntu, /etc/phpmyadmin/config.inc.php )

/* User for the advanced features */

$cfg['Servers'][$i]['controluser'] = 'pmauser'; 
$cfg['Servers'][$i]['controlpass'] = 'password_here';
9 7 4
38,600 points
i still get two xampp errors :
 mysqli::real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: YES)
Connection for controluser as defined in your configuration failed.
0 votes

Sometimes we get to see this error “mysqli_real_connect(): (hy000/1045): access denied for user 'root'@'localhost' (using password: no)” while we try to connect to our MySQL in xampp. This error message means that the connection to the database is not correct or you may have set different passwords for the user 'root' or have changed your password.

Solution:

There are many ways to solve this problem. Let’s see different ways of solving this problem.

Change your configuration file:

$cfg['Servers'][$i]['auth_type'] = 'config';

To

$cfg['Servers'][$i]['auth_type'] = 'HTTP';

Or, we can use:

/* Authentication type and info */
$cfg['Servers'][$i]['password'] = '';<----your password

Or, We can change:

/* User for advanced features */

$cfg['Servers'][$i]['controluser'] = 'pma';

$cfg['Servers'][$i]['controlpass'] = '';

To

/* User for advanced features */

$cfg['Servers'][$i]['controluser'] = 'your user';

$cfg['Servers'][$i]['controlpass'] = 'your password';

 

 

 

10 6 4
31,120 points

Related questions

0 votes
1 answer 97 views
97 views
Problem : Any help on this issue: Mysqli_real_connect(): (hy000/1045): access denied for user 'pma'@'localhost' (using password: no) .
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 5 views
5 views
Problem: Why I got the error > 1045 - access denied for user 'root'@'localhost' (using password yes) xampp
asked 5 days ago ummeshani 8.8k points
0 votes
1 answer 6 views
6 views
Problem: My localhost is saying error like Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\registration\includes\db.php on line 3 on the browser I have all things done here's the image of ... facing the errorand also if I am doing something wrong in my code editor then here's the image of the db.php db.php files code
asked 1 day ago sumaiya simi 43.9k points
0 votes
1 answer 556 views
556 views
Problem : I am currently using the Mac OS Yosemite and Laravel 5.0. I am new to Laravel 5.0. In the local environment whenever I run the below command php artisan migrate I always encounter below error : &ldquo;Access denied for user 'homestead'@'localhost' (using password: YES)&rdquo; I am unable to fix above error. Any clue to fix the above error?
asked Feb 13, 2020 mphil 2.3k points
0 votes
1 answer 12 views
12 views
Problem: When i try to connect to my sql server, it gives me the error: Warning: mysqli_connect(): (HY000/1044): Access denied for user ''@'localhost' to database 'dbtest'. I just created the user and gave it all permissions, but i still dosent work. Before i used another ... , $DBPASS, dbtest); // $dbcon = mysql_select_db($DBNAME); if ( !$conn ) { die("Connection failed : " . mysql_error()); } ?>
asked Apr 25 sumaiya simi 43.9k points
0 votes
1 answer 7 views
7 views
Problem: I know this question may have answers already in stackOverflow . But I have different issue here . I moved the laravel project from localhost to server . Which I have done every steps in server. I can able to view the login page in my server. The problem is, I ... 'root'@'localhost' (using password: NO) (SQL: select count(*) as aggregate from users where email = *Emails are not allowed*)
asked Apr 25 Yeamin 21.4k points
0 votes
1 answer 3 views
3 views
Problem: How to fix this error > 1045 - access denied for user 'root'@'localhost' (using password no) wamp
asked 3 days ago ummeshani 8.8k points
0 votes
1 answer 106 views
106 views
Problem : I am new to MySql. The problem started when I was unable to login to Mysql using my Mysql console. It is repeatedly asking me the password and now I am unable to remember my password. Can I change my password ? And now when I am trying to open my PhpMyAdmin ... WAMP and after that deleted all my related files and then reinstalled it .But it did not fix my issue. How can I fix the issue ?
asked Feb 26, 2020 mphil 2.3k points