Phabricator配置MySQL时出现的问题

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

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

4个回答

5

嗨,我在花费了两天的时间后很容易地解决了这个问题:

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

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

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

不要忘记引号!!!


4

如果我在存储升级命令中传递用户名/密码,存储现在可以使用新的DB凭据,但是它没有从配置文件中正确获取。我会检查配置并相应地进行更新。

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

1
在某些情况下,这还不够:./bin/storage upgrade 想要创建新的数据库,但 phabricatos 用户没有创建数据库的权限。因此,我建议使用以下 MySQL 代码,授予 phabricator 用户对所有现有和未来创建的数据库中的 phabricator_* 的全部权限:GRANT ALL PRIVILEGES ON phabricator_%.* TO 'phabricator'@'localhost';。请注意保留 HTML 标签。

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接