Book Image

OpenShift Cookbook

By : Shekhar Gulati
Book Image

OpenShift Cookbook

By: Shekhar Gulati

Overview of this book

Table of Contents (19 chapters)
OpenShift Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Running OpenShift on a Virtual Machine
Index

Accessing a MySQL database from your local machine


In the Adding a MySQL cartridge to your application recipe of this chapter, you learned how to access the MySQL database by performing an SSH into the application gear. In this recipe, you will learn how to connect with the MySQL database from your local machine.

Getting ready

To complete this recipe, you will need an application with a MySQL cartridge. Please refer to the Adding a MySQL cartridge to your application recipe to learn how to install a MySQL cartridge. Also, you will need the mysql command-line client on your machine. You can download the MySQL community server (which includes the mysql command-line client) from the official website at http://dev.mysql.com/downloads/mysql/.

How to do it…

Follow these steps to access the MySQL cartridge from your local machine:

  1. Open a command-line terminal, and change the directory to the myapp application directory. Execute the following command to forward remote ports to the local machine:

    $ rhc...