Question

I am able to get to the URL for phabricator. When I run the following the script from the phabricator directory, I receive the error copied below. I have also copied the mysql config info from the custom/myconfig.conf.php file (the credentials work - I can log on via the terminal using mysql -u root -p). I will change the credentials to non root once I can test the setup.

myconfig.conf.php

  // DatabaseConfigurationProvider.
  'mysql.configuration-provider' => 'DefaultDatabaseConfigurationProvider',

  // The username to use when connecting to MySQL.
  'mysql.user' => 'root',

  // The password to use when connecting to MySQL.
  'mysql.pass' => 'xxxxxxxxx',

  // The MySQL server to connect to.
  'mysql.host' => '127.0.0.1', ///'localhost',

  // If you want to connect to a different port than the default (which is 3306)
  'mysql.port' => null,

Error after running ./bin/storage upgrade

Unable To Connect: Attempt to connect to root@localhost failed with error #1045: Access denied for user 'root'@'localhost' (using password: NO).

MySQL is listening on 127.0.0.1:3306. I have tried the following as well (passing in root ID as well) but it did not work: ./bin/storage upgrade --user --password

Update: When I run the ./bin/storage upgrade command with a new set of credentials, I get the following error:

        [2014-05-07 16:15:16] EXCEPTION: (RuntimeException) Undefined property:

     DefaultDatabaseConfigurationProvider::$getPassword at

     [/usr/local/phabricator/libphutil/src/error/PhutilErrorHandler.php:216]

          #0 PhutilErrorHandler::handleError(8, Undefined property: 

    DefaultDatabaseConfigurationProvider::$getPassword,


     /usr/local/phabricator/phabricator/scripts/sql/manage_storage.php, 75, 

Array of size 16 starting with: { _GET => Array  }) called at 

    [/usr/local/phabricator/phabricator/scripts/sql/manage_storage.php:75]

The storage now works with a new DB credentials if I pass in the username/password in the storage upgrade command but its not picked up correctly from the conf file. I will check the conf and update this accordingly.

Was it helpful?

Solution 2

The storage now works with a new DB credentials if I pass in the username/password in the storage upgrade command but its not picked up correctly from the conf file. I will check the conf and update this accordingly.

./bin/storage upgrade --user "actual username" --password "actual password"

OTHER TIPS

hi i solved the issue very easily after spent 2 days :

./bin/config set mysql.host 'localhost'

./bin/config set mysql.user 'root'

./bin/config set mysql.pass 'pass'

don't forget the quotes !!!

In some situations this is not enough: ./bin/storage upgrade wants to create new database, but phabricatos user does not have privileges to create databases. So i suggest to grant all privileges phabricator user all phabricator_* for databases (existing and created in future) using this mysql code GRANT ALL PRIVILEGES ONphabricator_%.* TO 'phabricator'@'localhost';

late answer, hope it helps new comers

phabricator provides mechanism to configure the username and password for mysql connection

  phabricator/ $ ./bin/config set mysql.host __host__
  phabricator/ $ ./bin/config set mysql.user __username__
  phabricator/ $ ./bin/config set mysql.pass __password__

also alternatively you can update the config file at

phabricator/ $ ./conf/local/local.json

{
  "mysql.user": "phabricator_user_in_mysql"
}

make sure this user has proper access grants in mysql

then run ./bin/storage upgrade

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top