PhpMyAdmin

Qoddi App Platform is a complete infrastructure solution to deploy your code from Git, create apps from Marketplace and launch database servers.

PhpMyAdmin is a great tool to manage MySQL databases hosted on Qoddi’s cluster.

PhpMyAdmin is available as a one-click app from Qoddi’s Marketplace. Just select PhpMyAdmin from the Marketplace, select a size and location, and Qoddi will install PhpMyAdmin and make it available from your browser.

This tutorial will cover how to connect to a Qoddi MySQL database, modify the settings of PhpMyAdmin and connect to external databases that require SSL like PlanetScale.

PhpMyAdmin Installation

To install PhpMyAdmin, go to Marketplace from your Qoddi account and choose PhpMyAdmin from the list of one-click apps available:

Select a name for your app, choose if you add PhpMyAdmin to a current stack and the location where the app must be created:

Important: to access an existent MySQL database on Qoddi make sure to create PhpMyAdmin inside the same stack of the MySQL database.

After the creation process is complete go to the app setting page to access PhpMyAdmin:

Click on the Qoddi Domain name to access PhpMyAdmin:

To connect to a Qoddi MySQL database (remember, the MySQL database must be located inside the same stack), open the MySQL app settings page:

Internal Name is the server address you must use inside PhpMyAdmin srv-captain--ucoswxzkyhjbentgairp-db in this example

MYSQL_USER and MYSQL_PASSWORD are the credentials to use with PhpMyAdmin (or any other app that needs to access this MySQL database).

Additional configuration of PhpMyAdmin

PhpMyAdmin configuration can be altered using environment variables:

  • PMA_ARBITRARY – when set to 1 connection to the arbitrary server will be allowed (default)
  • PMA_HOST – define address/host name of the MySQL server
  • PMA_VERBOSE – define verbose name of the MySQL server
  • PMA_PORT – define port of the MySQL server
  • PMA_HOSTS – define comma separated list of address/host names of the MySQL servers
  • PMA_VERBOSES – define comma separated list of verbose names of the MySQL servers
  • PMA_PORTS – define comma separated list of ports of the MySQL servers
  • PMA_USER and PMA_PASSWORD – define username to use for config authentication method
  • PMA_ABSOLUTE_URI – define user-facing URI
  • HIDE_PHP_VERSION – if defined, will hide the php version (expose_php = Off). Set to any value (such as HIDE_PHP_VERSION=true).
  • UPLOAD_LIMIT – if set, will override the default value for apache and php-fpm (default value is set to 128M (128MB) by Qoddi)
  • PMA_CONFIG_BASE64 – if set, will override the default config.inc.php with the base64 decoded contents of the variable
  • PMA_USER_CONFIG_BASE64 – if set, will override the default config.user.inc.php with the base64 decoded contents of the variable

Custom Configuration File

You can load and alter the original config.inc.php file by adding a Virtual Disk to the PhpMyAdmin and editing this file using the File Browser app.

1/ Add /etc/phpmyadmin/ as a Virtual Disk on your PhpMyadmin App:

2/ Go to the Marketplace and launch a Filebrowser app inside the same stack as PhpMyAdmin:

3/ Open the Settings of the Filebrowser app and Link the app to the PhpMyAdmin virtual disk you previously created:

Once the disk is attached, click on the Qoddi domain name of the FileBrowser app. The login/password is always admin/admin by default. No need to set up a specific password since we will use this app only to modify the PhpMyAdmin configuration file and we will delete it just after.

Note: If you see a 502 Error page after this step just wait a little more time, the app is restarting.

4/ Open the config.inc.php and make the edits you need:

You can now close the FileBrowser app and delete it from your Stack, the modifications will persist inside the PhpMyAdmin virtual disk.

5/ Return to the PhpMyAdmin app setting page and click “Save” under the App Settings tab to restart the app and apply the modifications you made:

The app will restart and the new config.inc.php file will be loaded instead of the default configuration. If at any time you need to revert to the default configuration you can simply delete the virtual disk and PhpMyAdmin will restart with a default configuration file.

Access SSL databases

Some MySQL database requires an SSL connection to be accessed like PlanetScale databases. PhpMyAdmin default configuration doesn’t use SSL by default. To access an SSL-only database you need to modify the config.inc.php file using the method above and add this at the bottom of the file:

$i++;
$cfg['Servers'][$i]['ssl_ca'] = '/etc/ssl/certs/ca-certificates.crt';
$cfg['Servers'][$i]['ssl']=true;  

Was this helpful?

1 / 0