Using MySQL on Openshift - Red Hat's public cloud
- It's based on a gear and cartridge concept that abstracts container provisioning.
- Application deployment through Git, updating the application with each push to the remote repo.
Cartridges are what provide the run-time for each of the supporting technologies. Remote access is through a Web console and a dedicated SSH client (RHC). For the purpose of this post, we'll go through the following scenario:
1. Creating a new application on Openshift
2. Deploying the MySQL gear
3. Deploy the phpMyAdmin gear
4. Accessing phpMyAdmin to manage the database instance
5. Port forwarding to attach a local machine MySQL administration software
For the first step, you'll first have to:
- Register on Openshift
- Install the client tools, according to these instructions
- Configure the client tools for remote access.
After successfully finishing the pre-requisites, you can create a new application, called "mysqllab" for our MySQL scenario, with the PHP programming language specified using the following command:
It will create the application with the PHP cartdrige. OpenShift provides a wide range of languages and services, deployed in applications through a cartridge. Cartridges can be web frameworks, databases, monitoring services, or connectors to external backends:
After the database gear creation, you're presented with the database credentials information. You can also access those credentials at any time using the Web console:
Going over to the Web console, our gears are presented on the application. You can open phpMyAdmin from the popout link. The username and password are the same as the database credentials:
port forwarding, enter on the the command line:
Afterwards, try connecting your usual DBA tool. While the command prompt window is open, the ports are forwarded to and from the local host: