Page 2 of 2

Re: phpmyadmin can't access mysql after changing localhost P

PostPosted: 28. May 2013 22:31
by tedfull
In the phpmyadmin folder on your computer you will see a file called config.inc.php

Make sure to change this info with you new password:

/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = ' new password '; <---- This has to be changed to your new password
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

There is another config file and I think that is what is messing with people.

Re: phpmyadmin can't access mysql after changing localhost P

PostPosted: 29. May 2013 03:53
by Altrea
Hi tedfull,

Thank you for your feedback.

tedfull wrote:There is another config file and I think that is what is messing with people.

There is only one config file and one sample file. The name is very clear i think :D

best wishes,
Altrea

Re: phpmyadmin can't access mysql after changing localhost P

PostPosted: 30. May 2013 22:12
by Tektek
Hi,

I have also the same problem. I have tried all of the above suggestions, but it still does not work.

I have tried the following:
1. run resetroot.bat in mysql;
2. http://localhost/security/index.php to reset one password;
3. in config.inc.php, I have changed to the following setting:
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'testtesttest'; <- new password
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['compress'] = false;

4. in my.ini file I have also changed to new password:
password = testtesttest
port = 3306
socket = "/xampp/mysql/mysql.sock"
default-character-set = utf8

It still can not be connected. What is still missing at me? Thanks!

The original error is:
--------------------------------------------
Fehler
MySQL meldet:

#2002 -
Der Server antwortet nicht (evtl. ist der Socket des lokalen MySQL-Servers nicht korrekt konfiguriert).

Verbindung für den controluser, wie er in Ihrer Konfiguration angegeben ist, ist fehlgeschlagen.
-------------------------------------------

my SW version:
xampp: 1.8.1
os: windows 7
xampp control panel version: 3.1.0

Re: phpmyadmin can't access mysql after changing localhost P

PostPosted: 30. May 2013 22:22
by hackattack142
Hello,

You need to actually change the password in the database first before you can tell clients to use it.

If the root password is empty, you should be able to do this from the XAMPP security page

Re: phpmyadmin can't access mysql after changing localhost P

PostPosted: 30. May 2013 22:38
by Tektek
hello,

yes I can change the password from the XAMPP security page, and did it. I have changed the password to "testtesttest". And then tried to adapt the password in config.inc.php and my.ini. But it still does not work.

Re: phpmyadmin can't access mysql after changing localhost P

PostPosted: 31. May 2013 03:24
by hackattack142
You should not be putting passwords in my.ini

As for config.inc.php, if you want to use the password in this config file, you need to change this:
Code: Select all
$cfg['Servers'][$i]['auth_type'] = 'cookie';
from 'cookie' to 'config'

Re: phpmyadmin can't access mysql after changing localhost P

PostPosted: 31. May 2013 11:19
by Tektek
It works! Thanks very much!

Re: phpmyadmin can't access mysql after changing localhost P

PostPosted: 23. August 2013 16:58
by savvy
shukri_alquwatli I literally have no words to thank you. It's taken me two days to figure this out and I would've not done it without your post

Re: phpmyadmin can't access mysql after changing localhost P

PostPosted: 11. October 2015 02:03
by skullduggary
I had the same problems, I have found the solution and everything is now accessible and running.

Install Xampp as usual, do not try to change anything initially. Goto https://community.apachefriends.org/f/viewtopic.php?f=16&t=67997&p=244660#p244660 but make sure you do not follow the first method as this also locked me out. Scroll down the page until you get to 1b. Setting root password with phpMyAdmin where you are setting the password for root through phpMyAdmin.

Once you have done the above then scroll down until you get to 2. Let phpMyAdmin know the changes and follow the steps.

Then you will be able to login entering root and your new password in the relevant fields on the form.

if only I had found this page several installs ago.