0

I know that a lot of other people have posted about this problem, but none of the other solutions were able to help me, which makes me suspect I've made some very specific stupid mistake in setting this up.

I have a live Magento site in 2.1.7 that I want to test in my developer environment on local hosting (I'm new to all this btw). I'm using MAMP 3.5 for local hosting which is running PHP 7.0.8, and MYSQL 5.6.

When I go on my localhost:8888 I get the error,

(Zend_Db_Adapter_Exception): SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

Here is my env.php data:

    'host' => '127.0.0.1',
    'dbname' => '(DATABASE NAME)',
    'username' => 'root',
    'password' => '******',
    'active' => '1',
    'port' => '3306',

In PHPMyAdmin, there is only one user on the database, there doesn't appear to be a wildcard user or anything like that. The user in PHPMyAdmin matches the one in my env.php file, and matches the one that MAMP said to use when setting all this up.

I've tried resetting privileges on all the relevant files and folders, flushing caches and resetting my server, but nothing seems to work. I can't help but feel I've missed something obvious.

  • 1
    Is your root password in env.php correct? Some installations of MySQL default the root password to blank. If you can access your DB via PHPMyAdmin, you can probably pull your password from PHPMyAdmin's config. – RToyo Aug 09 '18 at 15:49
  • The root pwd in env.php is the same as the root pwd in PHPMyAdmin, and I ensured that that user has full access to the DB. – Jacob Burns Aug 09 '18 at 21:24

1 Answers1

0

Run this command in mysql cli or workbench and share the output:

show grants;

Also, you can try the below command to allow all privileges on root user:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'