3

我可以访问 phabricator 的 URL。当我从 phabricator 目录运行以下脚本时,我收到下面复制的错误。我还从 custom/myconfig.conf.php 文件中复制了 mysql 配置信息(凭据有效——我可以使用 mysql -u root -p 通过终端登录)。一旦我可以测试设置,我会将凭据更改为非 root。

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,

运行 ./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 正在监听 127.0.0.1:3306。我也尝试了以下方法(也传递了根 ID),但它不起作用: ./bin/storage upgrade --user --password

更新: 当我使用一组新凭据运行 ./bin/storage upgrade 命令时,出现以下错误:

        [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]

如果我在存储升级命令中传入用户名/密码,但它没有从 conf 文件中正确获取,则存储现在可以使用新的数据库凭据。我将检查 conf 并相应地更新它。

4

4 回答 4

5

嗨,我花了 2 天后很容易地解决了这个问题:

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

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

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

不要忘记引号!

于 2016-08-04T11:17:54.907 回答
4

如果我在存储升级命令中传入用户名/密码,但它没有从 conf 文件中正确获取,则存储现在可以使用新的数据库凭据。我将检查 conf 并相应地更新它。

./bin/storage upgrade --user "actual username" --password "actual password"
于 2014-05-07T17:17:54.050 回答
1

在某些情况下,这还不够:./bin/storage upgrade 想要创建新数据库,但 phabricatos 用户没有创建数据库的权限。GRANT ALL PRIVILEGES ON所以我建议使用这个 mysql 代码phabricator_%授予所有权限 phabricator 用户 all phabricator_* 用于数据库(现有和将来创建).* TO 'phabricator'@'localhost';

于 2018-03-12T11:28:01.560 回答
0

迟到的答案,希望对新人有帮助

phabricator 提供机制来配置 mysql 连接的用户名和密码

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

或者,您也可以在以下位置更新配置文件

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

{
  "mysql.user": "phabricator_user_in_mysql"
}

确保此用户在 mysql 中具有适当的访问权限

然后运行 ./bin/storage upgrade

于 2016-06-19T14:53:47.823 回答