No access
Posted by: dacfleming (---.dyn.optonline.net)
Date: July 22, 2014 09:18PM

Getting the following error:

[puu.sh]


Authentication to host '192.168.2.6' for user 'root' using method 'mysql_native_password' failed with message: Acess denied for user 'root'@'Pegasus' (using password: YES)


Pretty much I have two laptops. One laptop is what I'm running my WAMP off of (Like a server).


I'm in the development stages of my program and I need to be able to connect to the laptop (192.168.2.6)

I am able to connect to WAMP via browser, Although not with the software. When I go to log in via the browser, It doesn't require me to put in a password of some sort.

What could be the issue?

Options: ReplyQuote
Re: No access
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: July 23, 2014 10:21AM

Hi Dac,

I think this is just a lack of understanding of the MySQL signon requirements.

A MySQL account has 2 parts, one is the userid and the second is the domain that that userid is allowed to connect from, hence the error message contains 'root'@'Pegasus', root is the userid and 'Pegasus' must be the domain.
By Domain in this situation it means some identification of the client PC and I guess its used the laptops name.


WAMP's MySQL comes with 3 default accounts and they are :-

root@127.0.0.1
root@localhost
root@::1

So the 'root' userid is only allowed to connect to MySQL from these 3 domains (127.0.0.1, localhost, ::1 ) and these are 3 ways of saying ONLY THE PC RUNNING MySQL, its a security thing as root is the SUperUser and can do anything to databases.

So you will need to use phpMyAdmin to create another account that is allowed to connect from your client PC and it is normal to use its IP Address as the domain.


Its a good idea to leave the 'root' account as it is, and set a password on it for security, but thats another issue.

So I suggest you create another userid, lets say 'testing' and allow that account access from the above 3 domains and also your client PC's ip address as well.

So assuming the client PC is 192.168.2.7

testing@127.0.0.1
testing@localhost
testing@::1
testing@192.168.2.7
Adding User Accounts


Then give all the required privilages to that account on the database you are using for this application.

As your laptops are probably getting allocated their ip address's using the routers DHCP server it would be a good idea to make both these PC's use a STATIC ip address

How to set static ip address


You should then be able to connect from the Client PC to the MySQL server runninng on the other PC.

---------------------------------------------------------------------------------------------
(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


Sorry, only registered users may post in this forum.