Search code examples
openproject

openproject configure throws "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)"?


Installed openproject according to the CentOS 7 docs (https://www.openproject.org/download-and-installation/#installation) and after running sudo openproject configure, getting the error output as shown:

➜  ~ 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)

Never used MariaDB before, but from some basic checking (installed following 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

(where the passsword is just blank) the DB appears to be working and accessible. Removing and re-installing the mariadb-server package does not appear to change the behavior either. Never used openproject or mysql / mariadb before, so any advice on what could be happening here would be appreciated.


Solution

  • Did you choose Install and configure MySQL server locally during the configuration step?

    enter image description here

    If so, the package should automatically configure a random MySQL root password that is stored under the key mysql/root_password at /etc/openproject/installer.dat. If you can still access the database with an empty password, the setup failed to set a password correctly. It appears to take input from urandom.

    What you could try is running the following command while hitting enter in the MySQL password prompt:

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

    And then replacing the value at mysql/root_password at /etc/openproject/installer.dat.