Redmine#

Run SQL commands#

Via shell#

  1. Connect to the server as the report_user user:

    curl --silent --connect-timeout 1 crm.open-contracting.org:8255 || true
    ssh report_user@crm.open-contracting.org
    
  2. Open a MySQL console:

    mysql redmine -u report -p
    

Via application#

  1. Create an SSH tunnel as the report_user user, to forward MySQL’s port 3306 to a port number of your preference, for example:

    curl --connect-timeout 1 http://crm.open-contracting.org:8255/
    ssh -N report_user@crm.open-contracting.org -L 3307:localhost:3306
    
  2. Use any of the applications described at SQL databases. The general configuration is:

    Host

    localhost

    Port

    3307 (as above)

    Database

    redmine

    User

    report

    If using the mysql command, set the protocol:

    mysql redmine --host localhost --port 3307 --protocol TCP --user report -p
    

Open interactive consoles#

  1. Connect to the server as the redmine user:

    curl --silent --connect-timeout 1 crm.open-contracting.org:8255 || true
    ssh redmine@crm.open-contracting.org
    
  2. Change to the Redmine application’s directory:

    cd /home/redmine/public_html
    
  3. Open a Rails console:

    bundle exec rails console --environment=production
    
  4. Or, open a MySQL console (password in config/database.yml):

    bundle exec rails dbconsole --environment=production