Lesson Learned #91: How to connect to Azure Database for MySQL using PhpMyAdmin in WAMP environment
Published Jun 12 2019 11:22 AM 2,847 Views

Today, we received a good question about how to connect to Azure Database for MySQL or MariaDB using PhpMyAdmin in a WAMP environment.

After several tests it was very simple to configure it:

 

  • Install WAMP service (in this case in a Windows Server).
  • Once the installation finished and the Apache service is running, review if we are able to connect locally using http://127.0.0.01
  • As you could see in the image below, we have a link with name phpmyadmin.

data.png

 

  • But, before, you need to modify the file config.inc.php placed on the folder C:\wamp64\apps\phpmyadmin4.8.4 (based on my installation and version) and change the following parameters:
  • If you are connecting to Azure Database for MySQL you need to modify the section
    1. if($wampConf['SupportMySQL'] == 'on') {
      /* Server: localhost [1] */
       $i++;
       if($mariaFirst) $i++;
       $cfg['Servers'][$i]['verbose'] = 'MySQL';
       $cfg['Servers'][$i]['host'] = 'yourserver.mysql.database.azure.com';
       $cfg['Servers'][$i]['port'] = $wampConf['mysqlPortUsed'];
       $cfg['Servers'][$i]['extension'] = 'mysqli';
       $cfg['Servers'][$i]['auth_type'] = 'cookie';
       $cfg['Servers'][$i]['user'] = 'username@yourserver';
       $cfg['Servers'][$i]['password'] = '';
  • If you are connecting to Azure Database for MariaDB you need to modify the section
    1. if($wampConf['SupportMariaDB'] =='on') {
       $i++;
       if($mariaFirst) $i -= 2;
       $cfg['Servers'][$i]['verbose'] = 'MariaDB';
       $cfg['Servers'][$i]['host'] = '127.0.0.1';
       $cfg['Servers'][$i]['port'] = $wampConf['mariaPortUsed'];
       $cfg['Servers'][$i]['extension'] = 'mysqli';
       $cfg['Servers'][$i]['auth_type'] = 'cookie';
       $cfg['Servers'][$i]['user'] = '';
       $cfg['Servers'][$i]['password'] = '';
  • And after these modifications, you will be able to connect to them.

 

Enjoy!!

Version history
Last update:
‎Jun 12 2019 11:22 AM
Updated by: