PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, March 11, 2022

[FIXED] Changed root password for phpMyAdmin, now I can't access anything MAMP

 March 11, 2022     mamp, mysql, php     No comments   

Issue

I thoroughly searched StackOverflow and Google to find an answer to this and so far nothing has helped. It's killing me because my project was pretty much finished!

In the control panel in phpMyAdmin I changed the password for the root user from 'root' to a new password. When I quit working and came back to it I couldn't connect to the server through MAMP, receiving this error:

Checking MySQL databases failed. Error message: /Applications/MAMP/Library/bin/mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect

And this error on my localhost page:

Error: Could not connect to MySQL server!

I tried many things to try to resolve this issue, most of which I found from other SO questions. They are as follows:

  • Change the password in the config.inc.php file. I couldn't find the other files mentioned, probably because I'm not using Pro. MySQL and PhpMyAdmin config.inc.php Password issue on MAMP
  • Change the user and password $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'NewPassword'; to blank values and add $cfg['Servers'][$i]['AllowNoPassword'] = false;. Changed password in phpMyAdmin on a Mac using XAMPP, now unable to access localhost/phpmyadmin
  • Used terminal to change the password back to 'root', and change config.inc.php back to default. http://www.mamp.info/en/documentation/faq.html#q9
  • Tried step 2 without 'AllowNoPassword'
  • Changed $cfg['Servers'][$i]['host'] = 'localhost'; to $cfg['Servers'][$i]['host'] = '127.0.0.1';

I tried a bunch of other things like changing the auth_type to html, adding controluser and controlpass, and other things but no luck. Nothing seems to work.


Solution

If you have tried the old password and it still did not work, then you can try changing the password again.

http://www.mamp.info/en/documentation/faq.html#q9

EDIT

In order to debug if it is the MySQL or PHPMyAdmin that is the problem now, please try this.

Access MAMP's MySQL from Terminal

See if you can connect to mysql on the command line, if you can then we know it is your phpmyadmin config that is wrong, if not then it is the mysql server that is wrong.



Answered By - Anigel
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing