Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. docker external mysql database

docker external mysql database

Added by mad max about 8 years ago

Hi I have a problem with the docker official docker container and the option of using a external database. I used a mysql database and setup a databse: openporject and a user: openproject and granted all privileges for the database to the user.

I passed this to the openproject container via a docker-compose.yml:
- DATABASE_URL=postgres://openproject:password@openproject-db:5432/openproject

But I get the error if I start the container up:

Creating scope :open. Overwriting existing method WorkPackage.open.
openproject | rake aborted!
openproject |
openproject | * * * * * * * * * * * * * * * * * * * * * * * * * *
openproject |
openproject | * OpenProject expects to have the following sql modes set on MySql. *
openproject |
openproject | * Please ensure having set: *
openproject |
openproject | * variables: *
openproject | sql_mode:
openproject | * “no_auto_value_on_zero, *
openproject | strict_trans_tables, * strict_all_tables, *
openproject | no_zero_in_date, * no_zero_date, *
openproject | error_for_division_by_zero, * no_auto_create_user, *
openproject | no_engine_substitution”
openproject | * *
openproject | for the production environment in config/database.yml
openproject | * *
openproject | * * * * * * * * * * * * * * * * * * * * * * * * * *

How do I know if the openproject container uses the external database?


Replies (6)

RE: docker external mysql database - Added by Cyril Rohr about 8 years ago

Not sure if this will fix your issue, but your DATABASE_URL seems incorrect. The URl scheme is postgres, and the port is 5432, while MySQL usually listens on 3306. It should be something like:

DATABASE\_URL=mysql2://user:password@openproject-db:3306/openproject

RE: docker external mysql database - Added by Jan Weber almost 8 years ago

Had the same problem. But OP is connection to your external DB, thats why it can say you dont have set the right SQL_MODES.

Just set the right SQL modes ( best to set in config of mysql so it will be set automatically on startup)

RE: docker external mysql database - Added by Frank Hintsch over 7 years ago

Had the same problem and tried to set the sql_mode via environment:

OPENPROJECT_VARIABLES_SQL__MODE="no_auto_value_on_zero,strict_trans_tables,no_zero_date,strict_all_tables,no_zero_in_date,error_for_division_by_zero,no_auto_create_user,no_engine_substitution"

This had no effect, as well as trying other names like VARIABLES_SQL__MODE, OPENPROJECT_PRODUCTION_VARIABLES_SQL__MODE or PRODUCTION_VARIABLES_SQL__MODE.

Finally I gave up and followed Jan Weber’s advice. Success! Thanks Jan!

RE: docker external mysql database - Added by carlos martin over 6 years ago

Frank Hintsch wrote:

Had the same problem and tried to set the sql_mode via environment:

OPENPROJECT_VARIABLES_SQL__MODE=\"no_auto_value_on_zero,strict_trans_tables,no_zero_date,strict_all_tables,no_zero_in_date,error_for_division_by_zero,no_auto_create_user,no_engine_substitution\"

This had no effect, as well as trying other names like VARIABLES_SQL__MODE, OPENPROJECT_PRODUCTION_VARIABLES_SQL__MODE or PRODUCTION_VARIABLES_SQL__MODE.

Finally I gave up and followed Jan Weber’s advice. Success! Thanks Jan!

the only way it works is configuring in the mysql server the my.conf with the sql_mode that openproject requires?

In my case I have openproject on docker, and a server of the company's DB. I can not touch the my.conf because it would affect all the databases.

I have tried to mount the database.yml in openproject the sql_mode as requested, but it does not work.
     volumes:
       - ./database.yml:/usr/src/app/packaging/conf/database.yml

Any ideas?

RE: docker external mysql database - Added by Cyril Rohr over 6 years ago

Hello,

You are most likely not mounting the correct path, it should be :

volumes:
  - "./database.yml:/usr/src/app/config/database.yml"

RE: docker external mysql database - Added by carlos martin over 6 years ago

Solved, in the end it was problem of permissions in BBDD ... No connection could be established

Thanks

  • (1 - 6/6)
Loading...