title: OpenShift - Connecting to a scaled gear's MySQL cartridge from another gear
body: <p>I have a Node.js gear (not scaled) and a PHP gear (scaled) with a MySQL cartridge. I want to connect to the MySQL cartridge from the Node.js app.</p>
  
  <p>The documentation for this is not concise and seems outdated, but from what I've gathered I need to forward my MySQL port to the Node.js app.</p>
  
  <p>I created a public/private key pair on the MySQL gear using <code>ssh-keygen -f $OPENSHIFT_DATA_DIR/mykey</code>. Next I added the contents of <code>mykey.pub</code> into my RedHat account's Settings > Public Keys section. Next I tried to copy the private key to the Node.js server using <code>scp $OPENSHIFT_DATA_DIR/mykey 59bc0f5c50014651f7020097@nodegear-mydomain.rhcloud.com:~/app-root/data/.</code> but this gave me a permissions error, so next I tried <code>scp -i $OPENSHIFT_DATA_DIR/mykey $OPENSHIFT_DATA_DIR/mykey 59bc0f5c50014651f7020097@nodegear-mydomain.rhcloud.com:~/app-root/data/.</code> and I think that did what it needed to, but I'm not sure.</p>
  
  <p>Does that seem right? From here what do I do? And is there an easier way to connect to a database cartridge on another gear?</p>