【问题标题】:Issue with Phabricator configuration for MySQLMySQL 的 Phabricator 配置问题
【发布时间】:2014-06-17 03:31:13
【问题描述】:

我可以访问 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 并相应地更新它。

【问题讨论】:

    标签: php mysql phabricator


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

      ./bin/config set mysql.host 'localhost'
      
      ./bin/config set mysql.user 'root'
      
      ./bin/config set mysql.pass 'pass'
      

      不要忘记引号!!!

      【讨论】:

        【解决方案3】:

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

        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

        【讨论】:

          【解决方案4】:

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

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

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2012-10-21
            • 2019-09-13
            • 2018-05-03
            • 1970-01-01
            • 1970-01-01
            • 2015-06-21
            相关资源
            最近更新 更多