cancel
Showing results for 
Search instead for 
Did you mean: 

php bin magento setup:upgrade error

php bin magento setup:upgrade error

Hello,

 

I installed Magento 2.1.9 my local server (mamp on Mac OS X) but now I am trying to install Porto theme. Every time when I try to run php bin/magento setup:upgrade I am getting these error but I can write data on my database. What am I suppose to do?

 

thank you so much.

 

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

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

Re: php bin magento setup:upgrade error

Hi @baransengul,

 

That means your app/etc/env.php file has the wrogn database credentials.

Change these values:

 

  'session' => 
  array (
    'save' => 'files',
  ),
  'db' => 
  array (
    'table_prefix' => '',
    'connection' => 
    array (
      'default' => 
      array (
        'host' => 'localhost',
        'dbname' => 'YOUR_DATABASE_NAME',
        'username' => 'YOUR_DATABASE_USER',
        'password' => 'YOUR_DATABASE_PASSWORD',
        'model' => 'mysql4',
        'engine' => 'innodb',
        'initStatements' => 'SET NAMES utf8;',
        'active' => '1',
      ),
    ),
  ),
  'resource' =>

Then clean cache and try again.

Re: php bin magento setup:upgrade error

Thank you for your answer but it doesnt work, I am still getting same error.

I want to ask another question;

How can you run Magento 2 on your local machine or where do you test your codes, install theme which is you buy? Could you show me a way Smiley Happy 

Re: php bin magento setup:upgrade error

Hi @baransengul,

 

Can you try your crenndtials using the mysql console?

Maybe your credentials are wrong?

Also, if you changed the env.php file, did you remember to refresh cache?

 

About my local envirnment

It depends on which OS are you using currently.

In my case I use Linux so I have my local webserver with my local mysql server and I use my computer mostly for (Magento) development. So I have a copy of a regular server.

But this isn't the only way. You can use Virtual Machines or Docker. There are plenty of options.