Yehuda
Yehuda

Reputation: 1893

MySQL installation on a Mac

I've had some issues with install MySQL on my MacBook Pro (early 2011, OS X version 10.11.6). I've run the disk image a few times, each time a successful installation. From what I understand, though, I'm supposed to be provided with a temporary password upon installation, and I never am.

After installation, I enter my Terminal and type mysql, but I only ever get the following response:

ERROR 1045 (28000): Access denied for user 'foo'@'localhost' (using password: NO)

Is there something that I'm doing wrong? I know very little about command line coding, so the more detail you could provide the better.

Please let me know if there's any more information about this whole installation process that I need to provide, and I'll be sure to post it.

Thanks in advance.

Upvotes: 0

Views: 261

Answers (2)

yekurtal
yekurtal

Reputation: 1

If you are NOT provided with a default password upon completion, this should do the trick:

Quoting First google hit.

1 - Stop MySQL

sudo /usr/local/mysql/support-files/mysql.server stop

2 - Start it in safe mode:

sudo mysqld_safe --skip-grant-tables

3 - This will be an ongoing command until the process is finished so open another shell/terminal window, and log in without a password as root:

mysql -u root
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

4 - Change the lowercase ‘MyNewPass’ to what you want – and keep the single quotes.

\q

5 - Start MySQL

sudo /usr/local/mysql/support-files/mysql.server start

Thats it, now your root password will be updated.

Upvotes: 0

xitter
xitter

Reputation: 768

You should login to mysql client as follows -

mysql -uroot -p

Given you have kept root as the username.

Upvotes: 1

Related Questions