Accessing MySQL on Your Foundation Development Server From Your Local Machine

by dbaldwin

In some cases you’ll want to access MySQL on your Foundation development server directly from your local environment. Since we don’t allow remote database connections, we prefer that you create a simple port forward to your server. Issue the following command from your terminal:

ssh -L 3307:yourserver.ublip.com:3306 (JavaScript must be enabled to view this email address)

You’ll be prompted from your SSH password that was delivered in your Foundation welcome email. Now open a new terminal and fire up your MySQL client:

mysql -u root -p -h 127.0.0.1 -P 3307

After entering your MySQL password you’ll be able to execute remote queries. If you’re trying to run Rails locally against your Foundation database then make sure you update your database.yml file found in /opt/ublip/rails/current/config/database.yml:

development:
  adapter: mysql
  database: ublip_prod
  username: root
  password: **********
  host: localhost
  port: 3307