PHPMyAdmin provides an easy to use web interface to manage your MySQL database(s). Some of phpMyAdmin’s features include:
- Import data from CSV and SQL
- Export data to various formats: CSV, SQL, XML, PDF, Word, Excel, LaTeX and others
- Creating PDF graphics of the database layout
- Creating complex queries using Query-by-Example (QBE)
- Searching globally in a database or a subset of it
- Transforming stored data into any format using a set of predefined functions, like displaying BLOB-data as image or download link
- Live charts to monitor MySQL server activity like connections, processes, CPU/Memory usage, etc.
- Many more
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:
Then install phpMyAdmin:
After the installation is complete you’ll just want to make sure mysql is running once more:
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.
If you’d like further help using the software please consult the official PHPMyAdmin docs.
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:
SET PASSWORD FOR 'myUser'@'%' = PASSWORD('test');
From this point, I’ll get into the CLI for MySQL by doing:
mysql -u myUser -p
Then I’ll be prompted for my password.