安装phabricator时无法连接到mysql


Unable to connect to mysql while installing phabricator

我正在Linux中安装phabricator,并遵循了 https://secure.phabricator.com/book/phabricator/article/installation_guide/和 http://www.tecmint.com/install-phabricator-in-linux/的安装指南

当我尝试从网络网址访问phabricator时,我得到的响应如下

    Unable to connect to MySQL!
     Attempt to connect to root@127.0.0.1 failed with error #2003: Can't connect to MySQL server on '127.0.0.1' (13).
     Make sure Phabricator and MySQL are correctly configured.
To update these 4 value(s), run these command(s) from the command line:
phabricator/ $ ./bin/config set mysql.host value
phabricator/ $ ./bin/config set mysql.port value
phabricator/ $ ./bin/config set mysql.user value
phabricator/ $ ./bin/config set mysql.pass value

当我配置我的 mysql 并且如果我运行phabricator/ $ ./bin/storage upgrade时,我会收到错误

   [2015-01-20 18:12:04] EXCEPTION: (AphrontAccessDeniedQueryException) #1044: Access denied for user ''@'localhost' to database 'phabricator_audit' at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:301]
  #0 AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:275]
  #1 AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:181]
  #2 AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [<phutil>/src/xsprintf/queryfx.php:6]
  #3 queryfx(AphrontMySQLiDatabaseConnection, string, string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:219]
  #4 PhabricatorStorageManagementAPI::applyPatchSQL(string) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php:109]
  #5 PhabricatorStorageManagementUpgradeWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:396]
  #6 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:292]
  #7 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/sql/manage_storage.php:171]

如果我运行./bin/storage upgrade --user root --password root我收到错误

Raw MySQL Error: Attempt to connect to root@localhost failed with error
#1045: Access denied for user 'root'@'localhost' (using password: YES).

这是我的阿帕奇设置,

<VirtualHost *:80>
        ServerAdmin root@xxx.yyy.com
        ServerName xxx.yyy.com
        DocumentRoot /var/www/html/myprojectapp/phabricator/webroot
        RewriteEngine on
        RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
        RewriteRule ^/favicon.ico   -                       [L,QSA]
        RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]
<Directory "/var/www/html/myprojectapp/phabricator/webroot">
        Order allow,deny
        Allow from all
</Directory>
</VirtualHost>

我已按照安装指南中提供的所有说明进行操作。谁能帮我指出我的错误?

似乎Phabricator创建了很多phabricator_数据库,所以这应该可以解决问题:

GRANT ALL PRIVILEGES ON `phabricator'_%`.* TO phabricatoruser@'localhost';

您也可以尝试限制权限。

我遇到了同样的问题,修复非常简单:

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

不要忘记我花了 2 天来解决此问题的"引号"!!

这是一个

selinux问题。禁用它可以解决它。1 编辑此文件 vim/etc/selinux/config2 更改 SELINUX=强制执行 ---> SELINUX=禁用3 重启

很可能您的数据库用户没有创建权限。

使用 MySQL 登录:mysql -u user -p并尝试:create database temp;

如果未创建数据库,则需要向用户授予创建权限。

检查一下 mysql Grant 语法。

好的,我刚刚遇到了同样的问题,几个小时后我修复了它:(

似乎我的密码末尾有 dolar 符号 $

我将mysql密码更改为简单的字母和数字,没有特殊字符。

奇怪,但这为我解决了问题!

我没有进行任何额外的调查,但似乎 mysql 密码中的特殊字符存在问题。