Open link in a new tab

Content

Expand project menu

Using a remote database

My database.yml looks like:

# MySQL (default setup).

production:
  adapter: mysql
  database: openproject
  host: 10.10.10.40
  username: openproject
  password: <hidden>
  encoding: utf8

rake db:create:all fails with the following message:
This task only modifies local databases. openproject is on a remote host.

How can I configure OpenProject to work with a database installed on a server other than where OP is installed?

Message actions

Hi Anurag,

I fear rails no longer allows creating a remote database via db:create 1.

So you will have to do it by hand, which is not really hard to do. Connect to the DBMS and create the db by inserting:

CREATE DATABASE openproject CHARACTER SET utf8;
CREATE USER 'openproject'@'localhost' IDENTIFIED BY '<password of your choice>';
GRANT ALL PRIVILEGES ON openproject.* TO 'openproject'@'localhost';

The other commands like db:migrate should work fine from there.

BTW, we switched to mysql2 a while ago so this is way better tested.

Regards

Jens

Message actions

Thanks, Jens. That worked! :)

I was able to finish the installation and run OP’s dev webserver on our domain’s port 3000. All worked fine. Now I want to configure OP such that:

  • it’s hosted on nginx rather than its own dev webserver
  • it runs on port 80
  • it’s associated with a subdomain

Any clues or pointers would help. Pardon me, but I’m very new to RoR.