0

setup: mysql5.7 + macos catalina

I was driven crazy by the issue. Followed mysql official manual installation, but I cannot log in with generated temporary password enter image description here

I tried many solutions on other stackoverflow posts, none works for me like below

Unable to access MySQL after it automatically generated a temporary password

some guy told me this "sudo mysqld_safe --skip-grant-tables & but you'll have to figure out how to do that on Mac. Then you can just log into MySQl - mysql -u root from terminal."

I tried

jhxins-MacBook-Pro:bin jhxin$ sudo mysqld_safe --skip-grant-tables
Logging to '/usr/local/var/mysql/jhxins-MacBook-Pro.local.err'.
2020-06-09T23:45:28.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2020-06-09T23:45:29.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/jhxins-MacBook-Pro.local.pid ended

the expection should be ongoing state, but it ended immediatelly. Then "mysql -u root" still failed

nathan
  • 754
  • 1
  • 10
  • 24
  • You should be able to reset the root password yourself. Stop the server. Start it in safe mode -- On Linux that looks like `sudo mysqld_safe --skip-grant-tables &` but you'll have to figure out how to do that on Mac. Then you can just log into MySQl - `mysql -u root` from terminal. Then issue a `update user set authentication_string=PASSWORD("mynewpassword") where User='root';` And `flush privileges;` Then `quit;` -- Stop the server again and restart it normally. – Zak Jun 10 '20 at 00:00
  • @Zak I already tried this, not working for me . 1. sudo mysqld_safe --skip-grant-tables command ended immediately, not like ongoing state. 2. mysql -u root failed. – nathan Jun 10 '20 at 00:09

0 Answers0