2

I've changed password of localhost user of my AMPPS stack and now I can not log into phpmyadmin It Shows a pink message : Access Denied..., I have tried restoring all default configuration but have the same problem.

I've checked config.inc file and it's content was :

<?php /* Servers configuration */ $i = 0; /* Server: localhost [1] */ $i++; $cfg['Servers'][$i]['verbose'] = ''; $cfg['Servers'][$i]['host'] = '127.0.0.1'; $cfg['Servers'][$i]['port'] = ''; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = file_get_contents('/Applications/AMPPS/ampps/data/my.conf'); $cfg['Servers'][$i]['hide_db'] = '(information_schema|performance_schema)'; /* End of servers configuration */ $cfg['DefaultLang'] = 'en-utf-8'; $cfg['blowfish_secret'] = ''; $cfg['ServerDefault'] = 1; $cfg['UploadDir'] = ''; $cfg['SaveDir'] = ''; ?> 

This is my.conf file part that is related to the password :

# The following options will be passed to all MySQL clients [client] #password = your_password port = 3306 socket = {$path}/var/mysql.sock 

I have checked mysql.ini file too and there was just one field like :

# PASSWORD = (your passwrod) 

I removed # from the begining of that line and saved the file and I restarted Apache and mysql. I even quited the app and then reopend it but the problem was there and nothing changed.

I've checked my codes to see if I'm able to use my codes with the new password and it was working but the only problem is I can not go to phpmyadmin anymore.

4 Answers 4

2

I had the same issue and this solution worked for me : You can Reinstall It Again, Or if you don't want to lose anything just install it on another drive or disk and copy past configuration files. Remember If you want to change phpmyadmin password go to ampps app and from it's panel go to change mysql password from there you can change mysql and phpmyadmin password without any problem. the default password of mysql and phpmyadmin is 'mysql'.

Hope solve your problem.

Sign up to request clarification or add additional context in comments.

Comments

2

Really awkward. I ran into the same problem with Ampps on Windows when changing phpmyadmin to "no password". Afterwards I could not login anymore. Error message:

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

I just did a fresh installation to "solve" the issue.

Most of the "solutions" online suggest to change the /phpmyadmin/config.inc.php. Using cookie instead of config showed at least the login screen. But still, login was not possible.

$cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['AllowNoPasswordRoot'] = false; 

There must be a mismatch between the mysql settings (username / password) and the phpmyadmin settings (username "root", no-password). And maybe some security settings.

It would be very helpful if someone finds another solution.

One that could work: MySql How to set root password to null

Comments

1

Okay after about 2-3 hours of insane headbashing, I've manage to make it work, however even if phpmyadmin work, it will still disappoint you. It has nothing to do with the installation, so you can reinstall it if you wish. The first thing I did was checked my mysql error log and mac's Activity Monitor to make sure I have all mysql processes turned off:

killall -9 [processIDhere]

yet the mysqld process cannot be stopped, it simply changed to another process id.

So I tweaked the config.inc.php file a bit and made this change:

BEFORE: $cfg['Servers'][$i]['auth_type'] = 'config';
AFTER: $cfg['Servers'][$i]['auth_type'] = 'http';

However, the password is still not working.

So then this does the trick: I went to mysql/etc/my.conf, on line 17-18 with the #password , I uncommented it and put

# The following options will be passed to all MySQL clients [client] password = mysql (NOTE: if you changed the password, you need to input the updated pw here)

Then I went back to localhost/phpmyadmin and use root as username, and mysql as my default password and was able to login.

However, even if I am able to log in to phpmyadmin and create a table, there is an issue with establishing a connection to the a wordpress file I dropped in www/ for my manual configuration. I learned that using Softaculous' WordPress installation creates a different mysql process and db that lives in ampps/var/ than the one on phpmyadmin. I went to the terminal and login with this command to double check:

mysql -u root -p "mysql" and then use

SHOW TABLES;

This does show that the databases from the phpmyadmin are there. This kind of destroys the point if you want to use Softaculous WordPress installer. You would have to find another way to grab the mysql file. I think the answer is in the mysql/etc/my.conf file, since the socket is set to this path:

socket = /Applications/AMPPS/var/mysql.sock

I haven't play around with this yet, but I would assume tweaking this will redirect it to phpmyadmin socket instead of Softalicious service. Would someone let me know if I am on the right track. (the my.conf can also be found on clicking on the configuration button here:

Screen Shot 2017-01-12 at 6.24.18 PM.png

Comments

1

delete

$cfg['Servers'][$i]['verbose'] = ''; $cfg['Servers'][$i]['host'] = '127.0.0.1'; $cfg['Servers'][$i]['port'] = ''; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['auth_type'] = 'coockie'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = file_get_contents('/Applications/AMPPS/ampps/data/my.conf'); $cfg['Servers'][$i]['hide_db'] = '(information_schema|performance_schema)'; 

and paste

$cfg['Servers'][$i]['verbose'] = ''; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = ''; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['auth_type'] = 'cookie'; 

in

/phpmyadmin/config.inc.php.

work for me - MAC OSX, make your login now.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.