I have installed MySQL successfully (on Mac OS X) and am at the point where I want to create/show databases. MySQL Server Status says it's running but when I try to run mysql commands from /usr/local/mysql I get the error

ERROR 1045 (28000): Access denied for user 'Username'@'localhost' (using password: YES)

I am trying the command:


but still encountering this error and have done research to avoid this and came upon using this command to avoid granting permission

mysqld --skip-grant-tables

after running this command I get another error saying

mysqld: Can't change dir to '/usr/local/mysql-5.7.13-osx10.11->x86_64/data/' (Errcode: 13 - Permission denied)

2016-08-16T18:42:00.489762Z 0 [Warning] TIMESTAMP with implicit DEFAULT >value is deprecated. Please use --explicit_defaults_for_timestamp server >option (see documentation for more details).

2016-08-16T18:42:00.490049Z 0 [Warning] Insecure configuration for -->secure-file-priv: Current value does not restrict location of generated >files. Consider setting it to a valid, non-empty path...

I've been going in circles researching error after error and feel that I'm close but just missing one or a few key things. Please help me fix this!


To access Mysql without password you need to run it in safe mode.

1) Stop mysql

# service mysql stop

2) Run it in safe mode with the option you mentioned:

# mysqld_safe --skip-grant-tables &

3) Check if it is running in safe mode:

# pgrep -l mysql

you will see something like

2515 mysqld_safe
2875 mysqld

4) Now you can enter as a root without password:

# mysql -uroot
| improve this answer | |
  • When I type these commands in my terminal, there is no result. I'm typing exactly as you described "# pgrep -l mysql" and it's just going back to command the command line path as if I just hit enter with nothing in it. @Oleg_Bolden – Kandianne Pierre Aug 16 '16 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.