Bitnami phpMyAdmin for Open Telekom Cloud

phpMyAdmin is an easy to use management tool for MySQL that allows you to create and drop databases, create, drop and modify tables, delete, edit and add fields, execute SQL statements, manage keys on fields, manage privileges and export data in various formats through a web-based interface.

How to access phpMyAdmin?

For security reasons, phpMyAdmin is accessible only when using 127.0.0.1 as the hostname. To access it from a remote system, you must create an SSH tunnel that routes requests to the Web server from 127.0.0.1. This implies that you must be able to connect to your server over SSH in order to access these applications remotely.

IMPORTANT: Before following the steps below, ensure that your Web and database servers are running.
NOTE: The steps below suggest using port 8888 for the SSH tunnel. If this port is already in use by another application on your local machine, replace it with any other port number greater than 1024 and modify the steps below accordingly. Similarly, if you have enabled Varnish, your stack's Web server might be running on port 81. In this case, modify the steps below to use port 81 instead of port 80 for the tunnel endpoint.

Accessing phpMyAdmin on Windows

Watch the following video to learn how to easily access phpMyAdmin on Windows through an SSH tunnel:

In order to access phpMyAdmin via SSH tunnel you need an SSH client. In the instructions below we have selected PuTTY, a free SSH client for Windows and UNIX platforms. The first step is having PuTTY configured. Please, check how to configure it in the section how to connect to the server through SSH using an SSH client on Windows.

Once you have your SSH client correctly configured and you tested that you can successfully access to your instance via SSH, you need to create an SSH tunnel in order to access phpMyAdmin. For doing so, follow these steps:

  • In the "Connection -> SSH -> Tunnels" section, add a new forwarded port by introducing the following values:

    • Source port: 8888
    • Destination: localhost:80

    This will create a secure tunnel by forwarding a port (the "destination port") on the remote server to a port (the "source port") on the local host (127.0.0.1 or localhost).

  • Click the "Add" button to add the secure tunnel configuration to the session. (You'll see the added port in the list of "Forwarded ports").

    PuTTY configuration

  • In the "Session" section, save your changes by clicking the "Save" button.
  • Click the "Open" button to open an SSH session to the server. The SSH session will now include a secure SSH tunnel between the two specified ports.
  • Access the phpMyAdmin console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin.
  • Log in to phpMyAdmin by using the following credentials:

    • Username: root
    • Password: application password. (Refer to our FAQ to learn how to find your application credentials).

Here is an example of what you should see:

Access phpMyAdmin

If you are unable to access phpMyAdmin, verify that the SSH tunnel was created by checking the PuTTY event log (accessible via the "Event Log" menu):

PuTTY configuration

Accessing phpMyAdmin on Linux and Mac OS X

To access the application using your Web browser, create an SSH tunnel, as described below.

  • Open a new terminal window on your local system (for example, using "Finder -> Applications -> Utilities -> Terminal" in Mac OS X or the Dash in Ubuntu).
  • Make sure that you have your SSH credentials (.pem key file) in hand.
  • Run the following command to configure the SSH tunnel. Remember to replace KEYFILE with the path to your private key and SERVER-IP with the public IP address or hostname of your server:

       $ ssh -N -L 8888:127.0.0.1:80 -i KEYFILE bitnami@SERVER-IP
    
NOTE: If successful, the above command will create an SSH tunnel but will not display any output on the server console.
  • Access the phpMyAdmin console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:8888/phpmyadmin.
  • Log in to phpMyAdmin by using the following credentials:

    • Username: root
    • Password: application password. (Refer to our FAQ to learn how to find your application credentials).

Here is an example of what you should see:

Access phpMyAdmin

How to change the phpMyAdmin password?

The phpMyAdmin credentials are the same as those used to access the MySQL database. To modify the password, refer to this page.

How to increase the security of phpMyAdmin's login pages?

If you would like, add an additional layer of security by enabling Apache's authentication when accessing phpMyAdmin. Follow these steps:

  • Edit the /opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf file and add the following lines outside the Directory directive.

     <Location /phpmyadmin>
        AuthType Basic
        AuthName phpMyAdmin
        AuthUserFile "/opt/bitnami/apache2/users"
        Require valid-user
     </Location>
    
  • Change or set the phpMyAdmin access password using the following command and replacing PASSWORD with the new password:

     $ sudo /opt/bitnami/apache2/bin/htpasswd -cb /opt/bitnami/apache2/users administrator PASSWORD
    
  • Restart Apache to have the changes take effect:

    $ sudo /opt/bitnami/ctlscript.sh restart apache
    

Now, when accessing phpMyAdmin, users will be prompted to log in twice: first, with the username administrator and second, with the username root. The password for the first is the one set in the second step above. The password for the second can be obtained from the server launchpad or control panel.

How to export a database?

Follow these steps:

  • Log in to the included phpMyAdmin application using these instructions.

  • Select the application database in the left navigation menu. In this example, the database is named bitnami_wordpress.

  • Select the "Export" menu item.

    Database export

  • On the resulting page, select the "Quick" export method and the "SQL" output format.

  • Click "Go".

    Database export

An SQL export file will be created and downloaded to your desktop. Store this file carefully, as you will need it if you plan to later import the database back into MySQL.

How to modify the allowed limit for uploaded files?

Modify the following option in the /opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf file to increase the allowed size for uploads:

<IfModule php5_module>                                                                    
    php_value upload_max_filesize 80M
    php_value post_max_size 80M
</IfModule>

If you are using PHP-FPM, modify the settings in the /opt/bitnami/apps/phpmyadmin/conf/php-fpm/php-settings.conf file

php_value[upload_max_filesize]=80M
php_value[post_max_size]=80M

How to modify the execution time?

This parameter sets the timeout for Apache to run a script.

  • Modify it in the php.ini file.

     max_execution_time = 120     ; Maximum execution time of each script, in seconds
    
  • Modify the ExecTimeLimit value in the /opt/bitnami/apps/phpmyadmin/htdocs/config.inc.php file:

     $cfg['ExecTimeLimit'] = 120;
    

To set this execution timeout to be unlimited (apply this value only if really necessary), set the time limit to 0 in both cases.

Troubleshooting

Timeout error when importing zipped database

If you try to import a zipped database, you might see a timeout error because phpMyAdmin takes too long to execute the script. To fix this:

  • Set the ExecTimeLimit setting to 0 (infinite) as described here.

  • Try to import the file again.

Remember to change the ExecTimeLimit setting back to its original value once the import process ends.

otc