Deploy phpMyAdmin on BlueMix
phpMyAdmin is a free software tool written in php, intended to handle the administration of MySQl over the Web. phpMyAdmin supports a wide range of operations on MySQL, MariaDB and Drizzle. Frequently used operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) can be performed via the user interface, while you still have the ability to directly execute any SQL statement.
In the BlueMix category,we don;t have php runtime support that.So we will use php buildback to support that.I list the most import steps for you .
1.Since we need to use cf tool to deploy on the BlueMix,you need to download and install it from github.
https://github.com/cloudfoundry/cli
2.We use cf command or web console to create our mysql service.Before create the service,make sure you have use cf login -a api.ng.bluemix.net command to login into it.
create the MySQL service that the application will use. The command syntax is:
cf create-service SERVICE PLAN SERVICE_INSTANCE
The service name is mysql, the plan is 100, and the service instance name is mysql_NMU. So you'll create your MySQL service like this:
cf create-service mysql 100 mysql_NMU
Here I create mysql service name is called mysql_NMU
3.The next step you need to download or clone the phpMyAdmin package from github from below address
https://github.com/dmikusa-pivotal/cf-ex-phpmyadmin
4.After you donwoload the installation package and open the htdocs\config.inc.php file.
Located the line 28,change 'cleardb-n/a' to 'mysql-5.5' .Below is the code after change.
/*
* Read MySQL service properties from _ENV['VCAP_SERVICES']
*/
$services = json_decode($_ENV['VCAP_SERVICES'], true);
$service = $services['mysql-5.5'][0]; // pick the first service
4. Since we don;t want use the manifest.yml shipped in the default file,so we can use below command to push on the BlueMix.
cf push phpmyadminbluemix -b https://github.com/dmikusa-pivotal/cf-php-build-pack.git -m 128M --no-manifest --no-start
Bind previous created mysql service
cf bind-service phpmyadminbluemix mysql_NMU
The we can start our application use below command
cf start phpmyadminbluemix
5.After start the app,we need to use mysql credential to login into it.You can double click the application,click the runtime menu and find user name and password from Environment Variables.
6.Launch the url from the http://phpmyadminbluemix.mybluemix.net/,you can see below login screenshot.
7.Use the username and password provide by step5,you can login into it and maintain the mysql on the Cloud.
Deploy WebSQL on the BlueMix
WebSQL is the ultimate desktop replacement for managing your MySQL databases over the web. With interface that works just like your favourite desktop applications, you don't need to keep switching over webpages to get simple things done. Just login to your database and manage your database as if your are working on your desktop.It support MySQL, SQLite and PostgreSQL three dbs.
You can download the latest package from http://sourceforge.net/projects/mywebsql/files/stable/mywebsql-3.4.zip/download.
Deploy on the BlueMix for this php based application i same with phpMyAdmin.So I don't want to repeat the same steps here.But one place you might need to change on you side.Open the servers.php in the config foler.Change the code like below.If you want to manage PostgreSQL you can uncomment the line ,and comment mysql serice line for that.
/*
* Read MySQL service properties from _ENV['VCAP_SERVICES']
*/
$services = json_decode($_ENV['VCAP_SERVICES'], true);
$service = $services['mysql-5.5'][0]; // if you choose the mysql service
//$service = $services['postgresql-9.1'][0];//if use choose the postgresql-9.1
$host = $service['credentials']['hostname'];
$port=$service['credentials']['port'];
$SERVER_LIST = array(
'MySQL' => array(
'host' => $host. ':' . $port,
'driver' => 'mysql5'
)
/* 'Localhost PostgreSQL' => array(
'host' =>$host. ':' . $port,
'driver' => 'pgsql'
),
*/
);
If your deployment on BlueMix is successful,you should see below screenshot.







