Open link in a new tab

Content

Expand project menu

[SOLVED] MySQL Error after updating from 6.0.0 -> 6.0.3 packaged

After updating my OpenProject 6.0.0 installation to 6.0.3 (Packaged installation, CentOS) i get the following error after running openproject configure

rake aborted! Mysql2::Error: Can't connect to MySQL server on '127.0.0.1' (111) /opt/openproject/vendor/bundle/ruby/2.1.0/gems/mysql2-0.4.3/lib/mysql2/client.rb:87:in `connect' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/mysql2-0.4.3/lib/mysql2/client.rb:87:in `initialize'

Also tried command openproject reconfigure just incase, but still having the same error.

Didn’t change any other settings prior or after updating.

Using mysql -u openproject -p i am able to connect to MySQL without problems
Checked the installer.dat file in /etc/openproject but settings seems to be correct.

Message actions

Resolved the issue but don’t really understand why the problem occurred.

Tried to change my MySQL host from 127.0.0.1 to localhost, using openproject config:set HOST=localhost, checked and it changed the value, but after running openproject configure is changed back to ‘127.0.0.1’. Checked the /etc/openproject/installer.dat file but couldn’t find a value for this.

So eventually, hardcoded ‘localhost’ in file /opt/openproject/vendor/bundle/ruby/2.1.0/gems/mysql2-0.4.3/lib/mysql2/client.rb:87 on the error line, which fixed my issue.

So either way, 2 questions;

- How could this error occur, as the system setup didn’t change
- How can i change the HOST setting the proper way without the hardcode hack

Message actions

Hi Martin,

the MySQL hostname is not the same as the HOST config variable, the latter is for controlling the host used by OpenProject.

The MySQL connection URL is set in /etc/openproject/conf.d/database, where you can change the value.
Also, you can use openproject reconfigure, and choose existing MySQL installation to upgrade credentials.

Best,
Oliver

Message actions

Hi Oliver,

Thanks for the clarification on this, will change the database configuration the correct way.

Regards,
Martin