1

I have a brand new Mac running Mojave. I've installed MySQL multiple times on my older Mac and never had a problem. But this install, for whatever reason, isn't getting off the ground.

I have installed MySQL and started the server. At this point, all I wanted to do was verify the version from the command line, and this is what I get:

> mysql -v
ERROR 1045 (28000): Access denied for user 'milnuts'@'localhost' (using password: NO)
> mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I've scoured the plethora of other posts, this one being the closest, but almost all solutions require actually being able to connect to MySQL as root. I can't even do that. I never specified a password during the install process, so what am I missing here? Is there some new config in Mojave somewhere that I don't know about?

milnuts
  • 407
  • 2
  • 7
  • 16

2 Answers2

1

Try using MySQL Workbench. You can install it on their site, or if you are using homebrew (which I strongly recommend), simply brew cask install mysqlworkbench.

You might need to try reinstalling mysql. This can be a pain if you didn't install it using homebrew. But, if you did, you can simply brew uninstall mysql then brew install mysql.

homebrew makes permission problems like these almost non existent! Honestly you should install literally everything using it.

Lord Elrond
  • 13,430
  • 7
  • 40
  • 80
  • Thanks, I did install mysql using homebrew initially, but ran into this issue. See my answer below, but the problem appears to be with the password authentication method I selected during configuration. – milnuts Mar 19 '19 at 13:06
1

I finally got this working. With the latest version of MySQL, v8.0.15, (and maybe before as well), during the configuration step it asks you to configure the server using one of two options.

  1. Use Strong Password Encryption
  2. Use Legacy Password Encryption

The first four or five times I installed, I selected option #1 which says...

MySQL 8 supports a new, stronger authentication method based on SHA256. All new installations of the MySQL Server should use the this method.

Connectors and clients that don't support this method will be unable to connect to MySQL Server. Currently, connectors and community drivers that use libmysqlclient 8.0 support the new method.

On my last install, I selected option #2. That seemed to clear up all the problems I was experiencing. So it obviously had something to do with the authentication process.

milnuts
  • 407
  • 2
  • 7
  • 16