Access Denied For User Root Localhost Using Password No Mac Os



The user account named ”root” is a superuser with read and write privileges to more areas of the system, including files in other macOS user accounts. The root user is disabled by default. If you can log in to your Mac with an administrator account, you can enable the root user, then log in as the root user to complete your task.

Shell mysqladmin -u root -pxxxx-h somehostname ver Access denied for user 'root'@' (using password: YES) If you try to connect as root and get the following error, it means that you do not have a row in the user table with a User column value of 'root' and that mysqld cannot resolve the host name for your client.

The root user account is not intended for routine use. Its privileges allow changes to files that are required by your Mac. To undo such changes, you might need to reinstall your system software. You should disable the root user after completing your task.

  1. For some reason when I installed MySQL on my machine (a Mac running OS X 10.9) the 'root' MySQL account got messed up and I don't have access to it, but I do have access to the standard MySQL account 'sean@localhost' which I use to log into phpMyAdmin.
  2. MYSQL says #1045 - Access denied for user 'root'@'localhost' (using password: NO) I have tried OLDPASSWORD technique which won't work. I have almost wasted 2 days on this. Can someone really suggest how to come out of this and make phpMyAdmin work. Following are the edits i have done in config.inc.php file.
  3. How it all started: I was logged in to phpMyAdmin on my Macbook (which runs Mac OS X v10.7.4). I saw the message advising me to change the password of root, which by default has no password. I went to the Manage Privileges tab and changed the password for root on localhosts, webdev and 127.0.0.1.

It's safer to use the sudo command in Terminal instead of enabling the root user. To learn about sudo, open the Terminal app and enter man sudo.

Enable or disable the root user

  1. Choose Apple menu () > System Preferences, then click Users & Groups (or Accounts).
  2. Click , then enter an administrator name and password.
  3. Click Login Options.
  4. Click Join (or Edit).
  5. Click Open Directory Utility.
  6. Click in the Directory Utility window, then enter an administrator name and password.
  7. From the menu bar in Directory Utility:
    • Choose Edit > Enable Root User, then enter the password that you want to use for the root user.
    • Or choose Edit > Disable Root User.

Log in as the root user

When the root user is enabled, you have the privileges of the root user only while logged in as the root user.

  1. Choose Apple menu > Log Out to log out of your current user account.
  2. At the login window, log in with the user name ”root” and the password you created for the root user.
    If the login window is a list of users, click Other, then log in.

Remember to disable the root user after completing your task.

Change the root password

  1. Choose Apple menu () > System Preferences, then click Users & Groups (or Accounts).
  2. Click , then enter an administrator name and password.
  3. Click Login Options.
  4. Click Join (or Edit).
  5. Click Open Directory Utility.
  6. Click in the Directory Utility window, then enter an administrator name and password.
  7. From the menu bar in Directory Utility, choose Edit > Change Root Password…
  8. Enter a root password when prompted.

My Setup:

  • Mac OS X (v 10.5.8)
  • XAMPP for Mac
  • Firefox (v 6.0.2)
  • TextWrangler (v 3.1)
  • MySQL Administrator (v 1.2.12)
Access Denied For User Root Localhost Using Password No Mac Os

Difficulty Level:

3/5

#1045 – Access denied for user ‘root’@’localhost’ (using password: YES)

#1045 – Access denied for user ‘root’@’localhost’ (using password: NO)

Localhost

If you are a PHP developer and ever came across this scenario where you accidentally or for any reason deleted the root user or changed root’s password then you might get something like the error above accessing phpmyadmin.

This is a pain in the arse because the standard and easy way to change user/password and other settings of MySQL is phpmyadmin, which just stopped working apparently. This error shows that the user “root” doesn’t exist, or now the user “root” has password which phpmyadmin don’t know about.

Step1: Microsoft office for mac download.

If you’ve changed the password then the steps are easy. You just have to change the phpmyadmin “config.inc.php” file located at “XAMPP/xamppfiles/phpmyadmin/config.inc.php” in my case my XAMPP folder in Applications. Just change the line

$cfg[‘Servers’][$i][‘password’] = ”;

to

$cfg[‘Servers’][$i][‘password’] = ‘your_password’;

Editing config.php

Step 2:

Access Denied For User 'root'@'localhost' (using Password No) Mac Os

Every time you are going to change a file you have to restart MySQL. You also might have to change the file permission for modification, which will require your admin password.

If you have deleted the root user then you must have another user’s credentials. Follow the step 3 to fix this.

Access denied for user root localhost using password no mac os 10.13

Step 3:

In my scenario I had another account, which I used to create root user at host localhost. You’ll require MySQL Administrator for connection. Connect to your local MySQL and go to the Accounts tab.

Access denied for user

Creating Database User using MySQL Administrator

In the left hand side you will see Accounts section select “root” and from the bottom four buttons select “add host.”

If you can’t see “root” then add new user root.

Step 4:

Select the newly created user and select 2nd tab from the top named “Schema Privileges.” Because it’s a root user it should have access to everything logically so select all databases one by one from middle and transfer all the Available Privileges. Click Save Changes at bottom right corner and your new user is created.

Because the loopback address (127.0.0.1) and localhost means the same thing for local machines we can change the host of phpmyadmin and change it to “127.0.0.1”. It is very likely that you’ve deleted the root user at host named localhost but the user root at host 127.0.0.1 should still be there.

Step 5:

Access Denied For User Root Localhost Using Password No Mac Os Recovery Tool

You can change the host used to connect phpmyadmin. If anything happens with your localhost hostname you can easily move to 127.0.0.1 to connecto to phpmyadmin which will exactly be the same as localhost.

PHPMyAdmin Connected to 127.0.0.1

Access Denied For User Root Localhost Using Password No Mac Os

In the same config.inc.php file change the line

$cfg[‘Servers’][$i][‘host’] = ‘localhost’;

to

Access Denied For User Root Localhost Using Password No Mac Os 10.10

$cfg[‘Servers’][$i][‘host’] = ‘127.0.0.1’;

restart MySQL and phpmyadmin should work now.