#1045 Access denied user root@locahost(using password:N0)

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

#1045 Access denied user root@locahost(using password:N0)

Postby trapperdavis » 10. May 2017 14:59

Hello,

I am somewhat new to xampp, but I am having a problem with my MySQL server. I visited localhost/phpmyadmin, and reset my root@localhost user password as instructed. I was immediately given an Error 1045. I did the research of trying to resolve the problem and most solutions came in the form of changing the configuration file Config.inc.php. I changed
Code: Select all
$cfg['Servers'][$i]['password']=''
to
Code: Select all
$cfg['Servers'][$i]['password']='NO'
. Upon changing the file in my text editor (Brackets 2), I receive an error that I do not have permission to change the file. Can anybody help?

Thanks
trapperdavis
 
Posts: 2
Joined: 10. May 2017 14:48
XAMPP version: 5.6.30-1
Operating System: macOS Sierra v10.12.4

Re: #1045 Access denied user root@locahost(using password:N0

Postby Nobbie » 10. May 2017 21:13

trapperdavis wrote:and reset my root@localhost user password as instructed.


What do you mean by "as instructed"?? Who or what "instructs" you to do so?

trapperdavis wrote:Upon changing the file in my text editor (Brackets 2), I receive an error that I do not have permission to change the file. Can anybody help?


Obviously you (your UserID) does no have sufficient rights in order to change that file. Run as admin or ask in an OSX Forum how to change textfiles as administrator. That is not a Xampp issue.
Nobbie
 
Posts: 9503
Joined: 09. March 2008 13:04

Re: #1045 Access denied user root@locahost(using password:N0

Postby trapperdavis » 11. May 2017 20:09

Phpmyadim instructs me to do so. When logging onto localhost/phpmydmin for the first time with no password, a message is flashed at the bottom of the screen instructing me to change/update my password. This is why I changed it. This is also what is creating the problem.

Thank you for your answer. I will search those forums as well.
trapperdavis
 
Posts: 2
Joined: 10. May 2017 14:48
XAMPP version: 5.6.30-1
Operating System: macOS Sierra v10.12.4

Re: #1045 Access denied user root@locahost(using password:N0

Postby Nobbie » 11. May 2017 21:08

trapperdavis wrote:Phpmyadim instructs me to do so. When logging onto localhost/phpmydmin for the first time with no password, a message is flashed at the bottom of the screen instructing me to change/update my password. This is why I changed it. This is also what is creating the problem.


Yes of course, but this is only a hint. a notice. Of course you have to think about if you really need to do so. Only if your Xampp installation is exposed to the internet, you should protect MySQL via a password, but Xampp is not mentioned for Online access, so you simply should ignore that message. Happily, the message does not tell you to jump from the next bridge - would you do as well without thinking about "what am doing here"??
Nobbie
 
Posts: 9503
Joined: 09. March 2008 13:04

Re: #1045 Access denied user root@locahost(using password:N0

Postby moonwalker_repeat » 30. May 2017 06:42

Let me see if I can help. Hopefully the OP hasn't given up yet. By the way, Nobbie, there are plenty of reasons to set a password for PHPMyAdmin, I really do not think the OP should have to explain such a rudimentary need.

First of all, follow the instructions in the How to Guides in the Xampp homepage. This is the page that opens right after Xampp installation. Or you can use the following address on the host computer. localhost/dashboard/docs/reset-mysql-password/html

This will open instructions on how to change the MySQL password in the OSX terminal. It may be a good idea to use root access while executing that command.

After you've done that in terminal, it is possible that you may find errors on the PHPMyAdmin page. Don't panic. Just do the following:

First, change permissions in OSX for the main XAMPP folder so that you have read-write permissions. Do the same for the xamppfiles folder within, and the phpmyadmin folder within that folder as well. Next, change the permissions for config.inc.php, but this time make yourself the owner as well. If you don't know how to do this, you can just google OSX file permissions. It's not that complicated. All in the "Get Info" window in Finder.

NOW, open the config.inc.php file and look for the following lines:

Code: Select all

$cfg['blowfish_secret'] = 'changexampptosomethinglonger'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

/**
 * Servers configuration
 */
$i = 0;

/**
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'yourpasswordhere';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;



You'll notice that I've already made the necessary changes above, so to help you out, it's the following lines you'll want to change:

Code: Select all

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



If the above is left as default, you won't get a login screen, but will simply be logged in invisibly directly to the main PHPMyAdmin page (assuming you've made the other changes).

Code: Select all

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



This should be obvious, but it should be the same password you used in Terminal earlier.

Code: Select all

$cfg['Servers'][$i]['AllowNoPassword'] = false;



This is extremely important since leaving this as true will still (theoretically) allow other users in the default database to be used to login without passwords.

The only other thing I change is the following line just to get rid of the annoying warning message about the secret word being too short that will show up after logging into PHPMyAdmin.

Code: Select all

$cfg['blowfish_secret'] = 'changexampptosomethinglonger'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */



If I haven't forgotten any important details, this should activate the PHPMyAdmin login screen for PHPMyAdmin to function the way I think you're looking for.

Hopefully this should solve your problem!

If not, let me know. I may have forgotten a detail or two.
User avatar
moonwalker_repeat
 
Posts: 22
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: #1045 Access denied user root@locahost(using password:N0

Postby Nobbie » 30. May 2017 12:19

> By the way, Nobbie, there are plenty of reasons to set a password for PHPMyAdmin

Let me know, please. Why setting a password for a tool, what is not exposed to the internet on a PC which is only used by yourself in your development?

P.S.: I have not set any password on my PhpMyAdmin Installation. Feel free to destroy my data! My current IP is 93.239.168.168, if you need i will of course give you an update of my IP. And now show me, why i should have a password on my Xampps PhpMyAdmin installation!
Nobbie
 
Posts: 9503
Joined: 09. March 2008 13:04

Re: #1045 Access denied user root@locahost(using password:N0

Postby moonwalker_repeat » 30. May 2017 18:32

Nobbie, I never said YOU need a password. I said there are plenty of reasons one MAY want to activate the feature. Perhaps you may remember that older versions of Xampp red flagged no password on PHPMyAdmin.

I personally want it password protected because I access mine over lan and wan. Why? Because it's a royal pain to have to constantly go directly to the server to make necessary database changes. Also, it is not necessarily a bad thing to allow access from the Internet provided that one actually KNOWS how to protect Xampp folders and computers on the network.

I would NEVER recommend to anyone to open their Xampp installation to the Internet because I do not know what others are truly capable of in terms of protecting their own systems. I do so for my own purposes, and I believe I know what I'm doing or I would not do it. I've been using Xampp for about ten years now off and on, and while my shared hosted sites on professional servers have been hacked to death more than once, my private server has never been hacked.

Thanks for the invitation, but if you want your system hacked, you'll have to either do it yourself or wait for someone other than me. ;-p Peace!
Don't let the low number of posts fool you. I've been a Xampp user for many years. I opened a new account because I lost my old credentials for the forum.
User avatar
moonwalker_repeat
 
Posts: 22
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: #1045 Access denied user root@locahost(using password:N0

Postby Nobbie » 31. May 2017 09:40

moonwalker_repeat wrote:I said there are plenty of reasons one MAY want to activate the feature.


Not even one - if you REALLY need to activate a password, you are using Xampp in the wrong context. Xampp is designed for local development ONLY! Dont use Xampp, if you want to do different things.

moonwalker_repeat wrote:Perhaps you may remember that older versions of Xampp red flagged no password on PHPMyAdmin.


No, that wasnt Xampp, that was a check done by PhpMyAdmin. That was only a warning just in case you are running an online server. PhpMyAdmin of course cannot check the environment, but in a Xampp environment that warning was obsolete. Perhaps you may remember, that alll versions of Xampp are coming with a warning NOT to use it in a production environment. That is by far more safe than putting a password to single component.
Nobbie
 
Posts: 9503
Joined: 09. March 2008 13:04

Re: #1045 Access denied user root@locahost(using password:N0

Postby moonwalker_repeat » 01. June 2017 06:09

Nobbie, who said anything about running Xampp on a production environment in this thread? Xampp is often run on local LANs and WANs in perfectly legitimate development environments, which it is made for. In some of these environments project managers may want (actually NEED) to ensure restricted access for certain groups of developers, whereas others in the environment with access to the local network should be locked out. Not everyone who uses Xampp "legitimately" need be alone in a bubble. You are correct in saying that Xampp is designed intentionally only for development environments, but you would be incorrect to assume there is never any reason for needing certain security measures a bit more sophisticated than simply pulling the plug.
Don't let the low number of posts fool you. I've been a Xampp user for many years. I opened a new account because I lost my old credentials for the forum.
User avatar
moonwalker_repeat
 
Posts: 22
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: #1045 Access denied user root@locahost(using password:N0

Postby Nobbie » 01. June 2017 17:27

moonwalker_repeat wrote:Not everyone who uses Xampp "legitimately" need be alone in a bubble.


Exactly that is the case, as Xampp is configured only to access PhpMyAdmin from "localhost" and nothing else! You even cannot access PhpMyAdmin from another client.

Of course you CAN change everything, you can put your own configuration, you even can run Xampp in an online environment, IF YOU KNOW, what you are doing. And then of course you can put passwords where you want. But that is not the point. The point is: is there a need for a password for root in a standard Xampp installation? And the answer is still: NO. There is no need and there is no sense.
Nobbie
 
Posts: 9503
Joined: 09. March 2008 13:04

Re: #1045 Access denied user root@locahost(using password:N0

Postby moonwalker_repeat » 02. June 2017 03:10

Nobbie wrote:The point is: is there a need for a password for root in a standard Xampp installation? And the answer is still: NO. There is no need and there is no sense.


That is your opinion. Not fact. Others clearly feel differently and have their reasons. Why do you have such a huge problem with this that you feel the need to preach your own philosophy as superior?
Don't let the low number of posts fool you. I've been a Xampp user for many years. I opened a new account because I lost my old credentials for the forum.
User avatar
moonwalker_repeat
 
Posts: 22
Joined: 30. May 2017 05:38
Location: Earth
XAMPP version: 5.6.30
Operating System: OSX, Windows 10

Re: #1045 Access denied user root@locahost(using password:N0

Postby vannes » 11. July 2017 12:19

moonwalker_repeat wrote:
First, change permissions in OSX for the main XAMPP folder so that you have read-write permissions. Do the same for the xamppfiles folder within, and the phpmyadmin folder within that folder as well. Next, change the permissions for config.inc.php, but this time make yourself the owner as well. If you don't know how to do this, you can just google OSX file permissions. It's not that complicated. All in the "Get Info" window in Finder.


I also have the same problem, but I cannot change the permissions. When I try to change permissions of phpmyadmin folder, I get the error: The operation can’t be completed because you don’t have the necessary permission.

After lots of threads, the only thing I haven't tried so far is disabling SIP, because I am not advanced. Can you suggest a solution?
vannes
 
Posts: 3
Joined: 11. July 2017 11:00
XAMPP version: VM 7.1.6
Operating System: macOS Sierra 10.12.5

Re: #1045 Access denied user root@locahost(using password:N0

Postby Nobbie » 11. July 2017 21:09

To change permissions and/or ownership of a folder, which is not owned by your UserId, you must execute the chmod / chown commands with root permissions via "sudo" (i.e. "sudo chmod ....").
Nobbie
 
Posts: 9503
Joined: 09. March 2008 13:04

Re: #1045 Access denied user root@locahost(using password:N0

Postby Nobbie » 11. July 2017 21:11

To change permissions and/or ownership of a folder, which is not owned by your UserId, you must execute the chmod / chown commands with root permissions via "sudo" (i.e. "sudo chmod ....").
Nobbie
 
Posts: 9503
Joined: 09. March 2008 13:04


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 2 guests