
Mac Os X Access Denied For User 'root'@'localhost' (using Password: No)
Jul 28, 2013 - Using an incorrect password. Since you mentioned that you have defaulted the password to root, check if you have the CAPS lock on. Photoshop for a mac.
I tried to set a password to root user in MySQL in XAMPP at my iMac, but when I typed in Terminal /applications/XAMPP/xamppf iles/xampp security I got a message that the command should be executed as a root user. I am an administrator in my iMac but didn´t find a way how to start as a root user. Then I found a solution in this database (which at last was not applicble in my case): I run in SQL window in phpAdmin these comands: UPDATE mysql.user SET Password=PASSWORD('newpass word') WHERE User='root'; FLUSH PRIVILEGES; it ended successfully and changed 3 rows. After that I was not able to log into XAMPP's phpAdmin and got the error message in my title above. Questions: How do I get back into phpAdmin and be able to run sql? How should I have done the password changing correctly as a root user (how to log in as a root user, too)? Short answer: sudo bash Detailed answer: I do not know anything useful about administering MySQL, but this may help.
You may already know some of it, To simply execute a command as root user, precede it with sudo (as in 'sudo rm fileneme.txt' instead of 'rm fileneme.txt'. When you issue a sudo command, you are prompted for a password. Any admin password is good. You can log in as any user, including root with the login command (as in 'login root') but this requires the root user to be enabled, which is a security issue, and generally unnecessary.
A better way, which for most (if not all) purposes is the equivalent of logging in as root, without having the root user enabled, is to enter a bash session as root: sudo bash. Nxnw: there appears to be confusion about Unix root (which gives you full access to your operating system) versus MySQL root (which is a special account within the MySQL server which gives you access to issue SQL commands via your MySQL server). The issue appears to have been that the author has changed their MySQL root password and now is not able to use phpAdmin to administer the MySQL server as a result.
My suggestion is a direct answer to the question posed by the author: 'How do I get back into phpAdmin and be able to run sql?' Thank you, wolfgang_93. I do know the difference, but I am sure your clarification will assist the OP if it is not clear to him. I have answered the parts of the inquiry that I am able to answer. If you are able to tell him more, I am sure your contribution would be welcome. You will note that he said 'when I typed in Terminal /applications/XAMPP/xamppf iles/xampp security I got a message that the command should be executed as a root user'.
Here is is clearly issuing a unix command and the issue is UNIX root, not MySQL root. To execute that command as root user, he would type 'sudo /applications/XAMPP/xamppf iles/xampp security'. I gather that he wants or needs to do this, and I have told him how.
If you believe this is incorrect or irrelevant, again, I am sure your contribution would be welcome.
I'm trying to set a local environment on my new MacBook Air 13': built-in Apache with my own DocumentRoot, PHP, and MySQL. I usually update /etc/hosts just to run my local websites with a pretty permalink: local/example. For references, I usually check: • • • This time I'm simply getting a 403 Forbidden error every time I hit 127.0.0.1, localhost, or local. First I saw through the terminal that both Apache and PHP are running (even though I can't view PHP pages); then I updated all permissions according to; now I'm just desperate. Here are the relevant Apache configs: • /etc/hosts ( — added one line) • /etc/apache2/httpd.conf ( — updated the DocumentRoot) • /etc/apache2/users/joao.conf ( — created this file) • /etc/apache2/extra/httpd-vhosts.conf ( — updated VirtualHost) It looks like Apache is somehow denying me access to my DocumentRoot (which by the way is ~/Sites).
Because ~/Sites is actually a symlink, I then tried to update DocumentRoot with the following paths (all pointing to the same directory): • ~/Sites • /Users/joao/Sites • /Users/joao/Dropbox/Workflow/Sites (the original directory) Still throwing 403. Any ideas how to fix/debug this? I generally fix this by setting the Apache user to myself in local environments and in machines where the only user who uses Apache is me. In /private/etc/apache2/httpd.conf, set User to your username from _www, e.g.: User _www -> User joao And then restart Apache: $ sudo apachectl restart Additional steps: • If you have active sessions, they are going to give permission errors since they are still owned by _www. Own them: $ sudo chown joao: /var/tmp/sess_* Implications: After this, Apache (and PHP et al.) will run as you and will gain read/write permission to all of the files you have read/write permission. But since this is just a local development environment, that shouldn't be a problem unless you have no rules to block Apache in your firewall and let questionable files like file explorers, shells, scripts that may contain vulnerabilities run under Apache; in which case anyone including your public wifi neighbor in a cafe can enter and do whatever those scripts let them to do. In fact, you should prevent this regardless of the scripts you run or even if you don't set Apache user to yourself since you probably don't want random outsiders to be able to see the contents of your localhost.