Help please: Getting a "phpMyAdmin ERROR #1045"
Posted by: clsimco (---.lightspeed.irvnca.sbcglobal.net)
Date: April 09, 2015 09:16PM

Hello and thank you in advance.

First here is the info requested prior to asking a Q

1 - Windows 7 home 64 bit)
2 - Version WampServer 2.5 32 bit)
3 - Apache Version 2.4.9
4 - PHP Version 5.5.12
5 - MySQL Version 5.6.17
5a - SqlBuddy : 1.3.3
6 - What color is the WampServer icon (GREEN)
8 - access to localhost (Homepage WampServer)? YES
9 - access to phpMyAdmin? NO
10 - If you refer to an error message, please include the EXACT wording of the error in your post
11 - If you use an Antivirus and / or Firewall, please include the names of these
12 - full path to the installation of WampServer (E:\wamp\)

Exact wording of error Message:
______________________________
Access Denied
Welcome to phpMyAdmin

Error

MySQL said: Documentation
#1045 - Accès refusé pour l'utilisateur: 'root'@'@localhost' (mot de passe: NON)
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.
______________________________

What I did:

I upgraded my older version of WAMP to the current version
Had some database issues BUT I got them sorted out and phpMyAdmin was working well as was the entire installation. I followed instructions to make changes so that I do not set up vhosts, rather, use "localhost/" to navigate and display locally. No problem so far. THEN....

I used SqlBuddy to set password for root and all users AND created a user with the same Admin privileges and password.

That is when I ran into the ERROR. Tried to set password to none in the SqlBuddy interface butit does not correct the problem. Looked at the table for the user passwords but do not know what to change the password to to restore to defauld "no password" and then gain access to phpMyAdmin to accomplish what I started to do.

I can access, or, WAMP will serve regular html files from the home page but any php gives me the above error.

Thank you again.... I am very much a novice.... using WAMP only for development on local machine not as a www server.

Best........

[EDIT]

CORRECTION...... NOTE CORRECTION........

Actually everything above is true BUT I get that error above when trying to start phpMyAdmin.
When I try to access a php file fron the WAMP HOMEPAGE I also get the Following errot:

"Database Error......... Error establishing a database connection"



Edited 1 time(s). Last edit at 04/09/2015 09:42PM by clsimco.

Options: ReplyQuote
Re: Help please: Getting a "phpMyAdmin ERROR #1045"
Posted by: RiggsFolly (---.as43234.net)
Date: April 10, 2015 12:20PM

In the default installation of WAMPServer phpmyadmin is setup to use the 'root' userid with the default empty password.

Once you change the password on the 3 mysql root accounts you have to amend the phpmyadmin configuration.

There are a couple of options :-

Edit \wamp\apps\phpmyadminx.y.z\config.inc.php

Find this line

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

And put the new password in the quotes

$cfg['Servers'][$i]['password'] = 'MY_NEW_PASSWORD';


Second option, my prefered, and more secure in my opinion

Edit \wamp\apps\phpmyadminx.y.z\config.inc.php and change it to this

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
//$cfg['Servers'][$i]['auth_type'] = 'config';
//$cfg['Servers'][$i]['user'] = 'root';
//$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

This will cause phpmyadmin to throw a login page, so there is no password held in the file so nobody can get your root users password by viewing the file.

Also you can then use any User account you setup in MySQL to run phpmyadmin, you are not limited to just the root account, useful for testing that other accounts you setup have the correct privileges

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Help please: Getting a "phpMyAdmin ERROR #1045"
Posted by: clsimco (---.lightspeed.irvnca.sbcglobal.net)
Date: April 10, 2015 04:24PM

Thanks so much!!!!!

I'll do the second option this evening when I get back and let you know how it went.


Once again I REALLY appreciate your help!


Best......

Options: ReplyQuote
Re: Help please: Getting a "phpMyAdmin ERROR #1045"
Posted by: clsimco (---.lightspeed.irvnca.sbcglobal.net)
Date: April 11, 2015 04:51PM

Hello RiggsFolly

Again Thank You
Your solution 2 is what I used and it worked beautifully. Exactly what I wanted and hoped for.

I am a believer in the axiom that "If you don't ask the dumb questions you make the dumb mistakes." Therefore I have what may be a dumb question relevant to this thread.

In the USERS panel below:


USER HOST PASS GPRIV GRANT ACTION
--------------------------------------------------------------------------------------
Any % -- USAGE No Edit Privileges Edit Privileges Export Export
Any localhost No ALL PRIVILEGES No Edit Privileges Edit Privileges Export Export
user a localhost Yes ALL PRIVILEGES Yes Edit Privileges Edit Privileges Export Export
root 127.0.0.1 No ALL PRIVILEGES Yes Edit Privileges Edit Privileges Export Export
root ::1 No ALL PRIVILEGES Yes Edit Privileges Edit Privileges Export Export
root localhost Yes ALL PRIVILEGES Yes Edit Privileges Edit Privileges Export Export
user b localhost Yes ALL PRIVILEGES Yes Edit Privileges Edit Privileges Export Export


You see that I have modified root @ localhost and given a password indicated by the YES
I have also added user A and B with the same privileges.

Question:is there any good reason to, or not to, alter the privileges of the other "USERS" listed?

Again in the environment that I am running this setup I do not intend to broadcast to the internet, but use it only as a test or dev environment for my own website projects on a local machine..

Thank s again and have a enjoy your day......

Options: ReplyQuote
Re: Help please: Getting a "phpMyAdmin ERROR #1045"
Posted by: RiggsFolly (---.as43234.net)
Date: April 11, 2015 10:16PM

Well it really depend upon what you are going to use them for.

Its a good idea to create a user for a specific purpose i.e. user = fred is allowed to do only a specific set of things to fit what the user or application using that user to acess the database actually needs to do. This alos includes limiting user = fred to only be allowed to access a specific database.


ALSO: You have given a password to root@localhost but not root@127.0.0.1 and root@::1. This is going to trip you up later.
To demonstrate this if you launch phpMyAdmin using the url 127..0.1/phpmyadmin and attempt to use the
Username = root
Password = THE PASSWORD yoe set in root@localhost it will not work.

So set that same password onto all 3 root usernames.

Remember a MySQL user account comprises a username i.e. root and a HOST i.e. localhost or 127.0.0.1 or ::1

The host denotes where the user is logging on from.

So if you wanted to allow 'bill' to login from a specific ip address lets say 1.2.3.4, you would create the user 'bill'@'1.2.3.4'

I hope this makes sence, if not see my signature and follow the link to the MySQL documentation.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Help please: Getting a "phpMyAdmin ERROR #1045"
Posted by: clsimco (---.lightspeed.irvnca.sbcglobal.net)
Date: April 12, 2015 04:29AM

Thank you RiggsFolly

Very clear and articulate. Everything you say makes absolute sense and the reasoning obviously comes from experience.

Thanks for setting me on the right course.

Have a great day!

Options: ReplyQuote


Sorry, only registered users may post in this forum.