All HowTo's MySQL & MariaDB

Populating MySQL Within OpenShift

This document explains how to populate a MySQL database within OpenShift. In this example we have an application with three gears; HAProxy, PHP and MySQL. We have RHC configured. We have the SQL dump file available via http but it could be by ftp or ssh.

First we connect to the OpenShift application from our workstations. My OpenShift application is called “phptest”:

rhc ssh phptest

Now we get the SQL dump:

cd ~/app-root/data/
wget www.exmaple.com/mydump.sql

Create our database:

mysql
create database mydb;
quit

Now we can import our data:

mysql mydb < mydump.sql
rm ~/app-root/data/mydump.sql

At this stage you have a populated MySQL database.

Leave a Reply

Your email address will not be published. Required fields are marked *