Using PHPMyAdmin with Cloud9

Here we’ll explain how to install a PHPMyAdmin instance right in your workspace. Each workspace runs its own database and copy of PHPMyAdmin.

First, create a PHP workspace so you have PHP, MySQL, and Apache installed right away. You can then make sure you have MySQL installed by running:

mysql-ctl install

Then install phpMyAdmin:

phpmyadmin-ctl install

After the installation is complete you’ll just want to make sure mysql is running once more:

mysql-ctl start

After installing phpMyAdmin, you were given a link to access PHPMyAdmin which will follow the pattern of: https://[workspacename]-[username].c9users.io/phpmyadmin. From that link, you can login with your Cloud9 username and a blank password.

Creating a Database

You can create a database by clicking on the “Databases” tab up the top. On this page you’ll see a “Create database” field where you can enter the name and create a new database.

Security

Because MySQL has a blank password by default and phpMyAdmin uses the same credentials as MySQL, phpMyAdmin has a blank password by default as well. This is great because it makes setup significantly easier for users. Additionally, since developers generally don’t (and often shouldn’t) put sensitive/important data in a development environment like Cloud9, having no password on phpMyAdmin is rarely an issue.

If you do have sensitive data in the database in your workspace or if you feel safer locking down your database, you can simply change your MySQL password and lock down your database as you’d like to.

If my Cloud9 username is “myUser” then I can change my password to “test” by running:

Yes, this is a Cloud9 specific alias that just stands for control. You may also try using the vanilla/standard mysql command. I think that should work but I haven’t tried that in a long time so give it a shot.