openproject configure引发“错误1045(28000):用户'root'@'localhost'的访问被拒绝(使用密码:是)”?

时间:2018-09-25 21:37:53

标签: openproject

根据CentOS 7文档(https://www.openproject.org/download-and-installation/#installation)安装了openproject,并且在运行sudo openproject configure之后,得到如下所示的错误输出:

➜  ~ sudo openproject configure 
Launching installer for openproject...
Selected addons: legacy-installer mysql apache2 repositories smtp memcached openproject
[legacy-installer] ./bin/configure
[mysql] ./bin/configure
DONE
[apache2] ./bin/configure
DONE
[repositories] ./bin/configure
DONE
[smtp] ./bin/configure
DONE
[memcached] ./bin/configure
DONE
[openproject] ./bin/configure
[legacy-installer] ./bin/preinstall
[mysql] ./bin/preinstall
[apache2] ./bin/preinstall
Note: Forwarding request to 'systemctl enable httpd.service'.
[repositories] ./bin/preinstall
[smtp] ./bin/preinstall
[memcached] ./bin/preinstall
No memcached server to install. Skipping.
[openproject] ./bin/preinstall
[legacy-installer] ./bin/postinstall
[mysql] ./bin/postinstall
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

以前从未使用过MariaDB,但经过一些基本检查(安装在https://www.digitalocean.com/community/tutorials/how-to-reset-your-mysql-or-mariadb-root-password之后)

➜  ~ mysqladmin -u root -p version
Enter password: 
mysqladmin  Ver 9.0 Distrib 5.5.60-MariaDB, for Linux on x86_64
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Server version      5.5.60-MariaDB
Protocol version    10
Connection      Localhost via UNIX socket
UNIX socket     /var/lib/mysql/mysql.sock
Uptime:         21 min 38 sec

Threads: 1  Questions: 16  Slow queries: 0  Opens: 7  Flush tables: 2  Open tables: 25  Queries per second avg: 0.012

(密码只是空白),该数据库似乎正在运行并且可以访问。删除并重新安装mariadb-server软件包似乎也无法更改行为。以前从未使用过openproject或mysql / mariadb,因此,任何有关此处可能发生的情况的建议都将不胜感激。

1 个答案:

答案 0 :(得分:0)

您是否在配置步骤中选择了Install and configure MySQL server locally

enter image description here

如果是,则软件包应自动配置一个随机的MySQL root密码,该密码存储在mysql/root_password的密钥/etc/openproject/installer.dat下。如果仍然可以使用空密码访问数据库,则安装程序无法正确设置密码。 It appears to take input from urandom

您可以尝试在MySQL密码提示中按Enter的同时运行以下命令:

mysqladmin -u root -p password "<Create and insert a random password here>"

然后替换mysql/root_password/etc/openproject/installer.dat处的值。