【发布时间】:2015-01-20 18:24:42
【问题描述】:
我正在 linux 中安装 phabricator,并按照 https://secure.phabricator.com/book/phabricator/article/installation_guide/ 和 http://www.tecmint.com/install-phabricator-in-linux/ 的安装指南进行操作
当我尝试从 web url 访问 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).
这是我的 apache 设置,
<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>
我已按照安装指南中提供的所有说明进行操作。谁能帮我指出我的错误?
【问题讨论】:
-
您尝试将
mysql.host、mysql.pass、mysql.port和mysql.user设置为bin/config set? -
感谢您的快速回复。是的,我做到了:(当我运行存储升级时,我得到了错误
-
您是否尝试过使用
127.0.0.1作为主机而不是localhost您也可以使用相同的凭据(即mysql -u username -p -h hostname)连接命令行mysql 客户端吗? -
我按照您的建议尝试并收到以下错误,[root@codereview phabricator]# ./bin/storage upgrade MySQL Credentials Not Configured 无法使用配置的凭据连接到 MySQL。您必须先配置标准凭据,然后才能升级存储。运行这些命令来设置凭据:原始 MySQL 错误:尝试连接到 root@127.0.0.1 失败,错误 #1045:用户 'root'@'localhost' 的访问被拒绝(使用密码:是)。 [root@codereview phabricator]#
-
将 mysql.host 设置为
127.0.0.1而不是 @prodigitalson 建议的localhost解决了我的问题。谢谢!
标签: php mysql linux apache phabricator