phpmyadmin can't access mysql after changing localhost PW

Problems with the Windows version of XAMPP, questions, comments, and anything related.

phpmyadmin can't access mysql after changing localhost PW

Postby carriepr » 08. March 2012 00:45

Hello, I'm having problems opening phpmyadmin after I attempted to change the mysql password.

What I did to change it was to go to the privilages tab in phpmyadmin, and changed the password for root/localuser. As soon as I did that, I could no longer access phpmyadmin. I get the following error.

" MySQL said:
Cannot connect: invalid settings.

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 tried uninstalling XAMPP and reinstalling, but I still get this error. The samples under PHP in the XAMPP panel work fine, so I think mysql is running with no problems.

I checked the C:\xampp\phpMyAdmin\config.inc.php file, and there is no password set there, which is the default setting.

This was working fine before I tried to change the password. What do I need to reset to get this to work again?

Also, what all do I need to set to simply add a password for mysql database?
carriepr
 
Posts: 8
Joined: 08. March 2012 00:26
Operating System: Win7

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

Postby Sharley » 08. March 2012 00:49

Try right clicking on the \xampp\mysql\resetroot.bat file to run as an admin.

Then restart Apache and MySQL and see if you can access using root username and a blank password box.

Then to set a password for root user use the Security item in the XAMPP Welcome (Admin) page.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

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

Postby carriepr » 08. March 2012 18:41

I'm afraid this did not fix the problem. For a while, I was able to get the phpmyadmin to open again before running the BAT file, but I couldn't get any program to access the database. The control panel said it was running, but I was unable to start and stop either Apache or MySQL.

I tried resetting the password with the BAT file, and now when I try to login to phpmyadmin with no password, I get the following error.

phpMyAdmin - Error -Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

Also, the XAMPP samples can't connect to the database. I still can't turn off Apache or MySQL in the XAMPP control panel. The database appears to be in a weird state.

How do I reset everything back to the default setting?
carriepr
 
Posts: 8
Joined: 08. March 2012 00:26
Operating System: Win7

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

Postby deck2deck » 08. March 2012 19:54

The problem is almost certainly in the config.inc.php file. Don't worry, all is not lost... you'll be able to get back in.

You said: I checked the C:\xampp\phpMyAdmin\config.inc.php file, and there is no password set there, which is the default setting.

How do you know there is no password set there (what does it say)? I'm not an expert AT ALL but I've never seen a default setting with no password and the fact that you used to have one, but changed it, would support this.

Do you want to copy and paste the contents of your config.inc.php file here to let me take a look at it?
deck2deck
 
Posts: 12
Joined: 07. June 2011 16:09
Operating System: Windows Server 2008 R2, 6.1

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

Postby carriepr » 08. March 2012 20:42

This is what is currently in the config file.

$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
carriepr
 
Posts: 8
Joined: 08. March 2012 00:26
Operating System: Win7

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

Postby carriepr » 08. March 2012 20:53

I just tried again to change the password under Security. Then I edited the config file for phpmyadmin to have the same password. I still can't log in to phpmyadmin page.

I think a major problem is I can't seem to stop either Apache or MySQL in teh XAMPP Control Panle. They both stay running. Pressing Stop gives ERROR: -1 MySql service not stopped.

When I attempt to uncheck Svc for either gives ERROR: Apache is currently running or ERROR: MySql is currently running.

How do I fix the control panel so that I can easily stop and start Apache and MySql?
carriepr
 
Posts: 8
Joined: 08. March 2012 00:26
Operating System: Win7

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

Postby deck2deck » 08. March 2012 21:51

This might sound like a dumb question but did you try logging in with username of root and no password?
deck2deck
 
Posts: 12
Joined: 07. June 2011 16:09
Operating System: Windows Server 2008 R2, 6.1

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

Postby deck2deck » 08. March 2012 22:01

I think what you're describing may be a fairly common issue. I'm assuming you're on a Windows platform, correct? What version of Control Panel are you using? Make sure you have the latest version and if not you may wish to update it. I believe you can do it safely without disturbing your content.

But first try this: Start->Programs->Administrative Tools->Services. Then find Apache and MySql and see if you can stop them there.

Once you get this all sorted, you may wish to upgrade your Control panel. Good luck!
deck2deck
 
Posts: 12
Joined: 07. June 2011 16:09
Operating System: Windows Server 2008 R2, 6.1

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

Postby Sharley » 08. March 2012 23:25

@ deck2deck
Would you be so kind as to add your XAMPP version and Operating System to your profile as per these instructions and associated information:
viewtopic.php?f=16&t=48626
Thanks. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

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

Postby hackattack142 » 08. March 2012 23:28

@carriepr
1. Checking and unchecking the boxes in that control panel is for installing/uninstalling the services, not starting/stopping them. If you want to uninstall them via the control panel, you need to stop them first via the start/stop button to the right of that check box a ways.
2. If you are not using the newer control panel, give that a try (xampp-control-3-beta.exe)
3. By default, phpMyAdmin reads from the configuration file for the password. If you set the password directly in the database, you need to either change the way that phpMyAdmin authenticates or add the password to that config file. If you wish to change the authentication method, you can open your config.inc.php file, find this line
Code: Select all
$cfg['Servers'][$i]['auth_type'] = 'config';
and change it to
Code: Select all
$cfg['Servers'][$i]['auth_type'] = 'cookie';
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

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

Postby rw1 » 10. March 2012 13:36

hello,

xampp: 1.7.7
os: windows 7
xampp control panel version: 3.0.2

i am also experiencing the same issue.

it was my first time installing xampp, so as it was a new process i cannot completely remember my steps, but i think they were:

- install xampp
- go to localhost/xampp and click 'security'
- notice that some things stated 'unsecure'
- click on the link below this called http://localhost/security/xamppsecurity.php
- change the 'MYSQL SECTION: "ROOT" PASSWORD'
- change the 'XAMPP DIRECTORY PROTECTION (.htaccess)'

at some point i have also gone into xampp/phpMyAdmin/config.inc.php and chaged this line:
Code: Select all
$cfg['blowfish_secret'] = 'anewphrasehere'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

i was getting the error message that was in the original post when going to localhost/xampp > clicking on phpMyAdmin:

"MySQL said:
Cannot connect: invalid settings.

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".

but after following suggestions in last post and changing:
Code: Select all
$cfg['Servers'][$i]['auth_type'] = 'config';

to:
Code: Select all
$cfg['Servers'][$i]['auth_type'] = 'cookie';

in xampp/phpMyAdmin/config.inc.php, when i click on phpMyAdmin i am taken to a phpMyAdmin login page, but entering the username/password that are in xampp/phpMyAdmin/config.inc.php gives me this error:

'Cannot log in to the MySQL server'

please let me know if i need to provide any more information.

thank you!

edit: i'm also noticing that when changing MySQL password in http://localhost/security/index.php and selecting either 'http' or 'cookie', this choice is not being changed in the phpMyAdmin/config.inc.php file, ie if you type the auth type as 'http' into that file, then change password and select auth type as 'cookie' in the web interface, it stays defined as 'http' in the phpMyAdmin/config.inc.php file.

edit 2: also tried deleting root password by running resetroot.bat as suggested in the link below and i couldn't access phpMyAdmin.

http://community.apachefriends.org/f/viewtopic.php?f=16&t=50048&sid=09ec1ac8b1aa12e4f2385b40e4beda27#p192991

edit 3: also tried suggestions in this link but unfortunately they had no effect:

http://community.apachefriends.org/f/viewtopic.php?f=16&t=50063&sid=09ec1ac8b1aa12e4f2385b40e4beda27#p193021
rw1
 
Posts: 1
Joined: 10. March 2012 13:08
Operating System: Windows 7

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

Postby boeta87 » 16. July 2012 18:55

Hi All,

I experienced the exact same problem with my localhost!

what worked for me ==>
Open http://localhost/security/ in your browser, select your language and it will display a link somewhere like this ( => http://localhost/security/xamppsecurity.php <= [allowed only for localhost] )

That took me to a page where i could change my password AND export it to a text file while I'm at it! :roll:

You can select the checkbox to save the password to this directory:
(File: C:\xampp\security\security\mysqlrootpasswd.txt)

when all this is done and you still get access denied on http://localhost/phpmyadmin, just Refresh your page and cookies (CTRL+F5) and whala!

Hope this resolves your problem!
boeta87
 
Posts: 1
Joined: 16. July 2012 18:46
Operating System: Windows 7

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

Postby shukri_alquwatli » 29. December 2012 12:18

After you change the root password and modify the config.inc.php, you need to enter the username (root) and the new password into phpmyadmin login page.

In the page where it says "access denied": just look for the little gray square icon under the error messages all the way to the right.

You will have to enter the username and password everytime you try to access the phpmyadmin (this is the whole purpose of the password, right?) :)

It took me one hour plus XAMPP reinstall to figure this one out.
shukri_alquwatli
 
Posts: 1
Joined: 29. December 2012 12:07
Operating System: Win 7

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

Postby jonboucard » 18. January 2013 18:33

shukri_alquwatli wrote:After you change the root password and modify the config.inc.php, you need to enter the username (root) and the new password into phpmyadmin login page.

In the page where it says "access denied": just look for the little gray square icon under the error messages all the way to the right.

You will have to enter the username and password everytime you try to access the phpmyadmin (this is the whole purpose of the password, right?) :)

It took me one hour plus XAMPP reinstall to figure this one out.


Thanks for posting this. You get asked to check status, told you have no password, diligently change password, then cannot get in. Not exactly confidence inspiring for a noob :roll:

Now, obviously a password is best, how can the phpmyadmin landing screen be set to jump straight to the login page bypassing the very scary looking red warning screen...
jonboucard
 
Posts: 1
Joined: 18. January 2013 18:29
Operating System: Win 7 x64 Home Premium

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

Postby Tysiana » 14. April 2013 10:59

Hi

I'm experiencing the same problem and i tried to click 'open new PhpMyAdmin window' icon and it takes me to the main panel but I can't access phpMyAdmin database and i'm getting the error again. It doesn't show me any login panel at all.
Tysiana
 
Posts: 1
Joined: 14. April 2013 10:55
Operating System: Windows 7 Home Premium

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 134 guests