0

I keep running into the following error message when I try to access MySQL (8.0.25) using MyPhpAdmin on Mac.

mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)

I've tried to follow different solutions like this, but I'm running into different error messages. Not sure what to do. I even downgraded MySQL to no avail.

I read the manual but could not find much.

When I run

sudo /usr/local/mysql/bin/mysql  

I receive

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

When I run the following and typed the password

sudo /usr/local/mysql/bin/mysql -u root

I receive

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

When I run

sudo /usr/local/mysql/bin/mysqld --skip-grant-tables

I receive

[System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.25) starting as process 2733
2021-11-17T22:09:59.111529Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql-8.0.25-macos11-x86_64/data/ is case insensitive
2021-11-17T22:09:59.111580Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2021-11-17T22:09:59.111630Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-11-17T22:09:59.111785Z 0 [System] [MY-010910] [Server] /usr/local/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.25)  MySQL Community Server - GPL.

It does not allow access regardless of how I try. Not sure where to go from here.

Amir
  • 1
  • 1
  • The first few errors are because you are not specifying a password. Use the `-p` argument to prompt for one. If you forgot the password, using `--skip-grant-tables` can help with that, but you have to run MySQL as the appropriate user, not `root`. (Probably the username is `mysql`) – Evert Nov 17 '21 at 22:30
  • Thanks @Evert I used -p and typed the password but it returned an error. sudo /usr/local/mysql/bin/mysql -u root -p Password: Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) – Amir Nov 17 '21 at 22:55
  • 1
    then you have the wrong password! – Evert Nov 18 '21 at 02:41

0 Answers0