Home
%3CLINGO-SUB%20id%3D%22lingo-sub-688237%22%20slang%3D%22en-US%22%3ELesson%20Learned%20%2391%3A%20How%20to%20connect%20to%20Azure%20Database%20for%20MySQL%20using%20PhpMyAdmin%20in%20WAMP%20environment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-688237%22%20slang%3D%22en-US%22%3E%3CP%3EToday%2C%20we%20received%20a%20good%20question%20about%20how%20to%20connect%20to%20Azure%20Database%20for%20MySQL%20or%20MariaDB%20using%20PhpMyAdmin%20in%20a%20WAMP%20environment.%3C%2FP%3E%0A%3CP%3EAfter%20several%20tests%20it%20was%20very%20simple%20to%20configure%20it%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EInstall%20WAMP%20service%20(in%20this%20case%20in%20a%20Windows%20Server).%3C%2FLI%3E%0A%3CLI%3EOnce%20the%20installation%20finished%20and%20the%20Apache%20service%20is%20running%2C%20review%20if%20we%20are%20able%20to%20connect%20locally%20using%20%3CA%20href%3D%22http%3A%2F%2F127.0.0.01%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2F127.0.0.01%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EAs%20you%20could%20see%20in%20the%20image%20below%2C%20we%20have%20a%20link%20with%20name%20phpmyadmin.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117938i1A268CE03D616992%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22data.png%22%20title%3D%22data.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EBut%2C%20before%2C%20you%20need%20to%20modify%20the%20file%20%3CSTRONG%3Econfig.inc.php%3C%2FSTRONG%3E%26nbsp%3Bplaced%20on%20the%20folder%20C%3A%5Cwamp64%5Capps%5Cphpmyadmin4.8.4%20(based%20on%20my%20installation%20and%20version)%20and%20change%20the%20following%20parameters%3A%3C%2FLI%3E%0A%3CLI%3EIf%20you%20are%20connecting%20to%20Azure%20Database%20for%20MySQL%20you%20need%20to%20modify%20the%20section%3COL%3E%0A%3CLI%3E%3CSTRONG%3Eif(%24wampConf%5B'SupportMySQL'%5D%20%3D%3D%20'on')%20%7B%3C%2FSTRONG%3E%3CBR%20%2F%3E%2F*%20Server%3A%20localhost%20%5B1%5D%20*%2F%3CBR%20%2F%3E%26nbsp%3B%24i%2B%2B%3B%3CBR%20%2F%3E%26nbsp%3Bif(%24mariaFirst)%20%24i%2B%2B%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'verbose'%5D%20%3D%20'MySQL'%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'host'%5D%20%3D%20'yourserver.mysql.database.azure.com'%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'port'%5D%20%3D%20%24wampConf%5B'mysqlPortUsed'%5D%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'extension'%5D%20%3D%20'mysqli'%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'auth_type'%5D%20%3D%20'cookie'%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'user'%5D%20%3D%20'username%40yourserver'%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'password'%5D%20%3D%20''%3B%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3EIf%20you%20are%20connecting%20to%20%3CSTRONG%3EAzure%20Database%20for%20MariaDB%3C%2FSTRONG%3E%20you%20need%20to%20modify%20the%20section%3COL%3E%0A%3CLI%3E%3CSTRONG%3Eif(%24wampConf%5B'SupportMariaDB'%5D%20%3D%3D'on')%20%7B%3C%2FSTRONG%3E%3CBR%20%2F%3E%26nbsp%3B%24i%2B%2B%3B%3CBR%20%2F%3E%26nbsp%3Bif(%24mariaFirst)%20%24i%20-%3D%202%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'verbose'%5D%20%3D%20'MariaDB'%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'host'%5D%20%3D%20'127.0.0.1'%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'port'%5D%20%3D%20%24wampConf%5B'mariaPortUsed'%5D%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'extension'%5D%20%3D%20'mysqli'%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'auth_type'%5D%20%3D%20'cookie'%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'user'%5D%20%3D%20''%3B%3CBR%20%2F%3E%26nbsp%3B%24cfg%5B'Servers'%5D%5B%24i%5D%5B'password'%5D%20%3D%20''%3B%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3C%2FLI%3E%0A%3CLI%3EAnd%20after%20these%20modifications%2C%20you%20will%20be%20able%20to%20connect%20to%20them.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEnjoy!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-688237%22%20slang%3D%22en-US%22%3E%3CP%3EToday%2C%20we%20received%20a%20good%20question%20about%20how%20to%20connect%20to%20Azure%20Database%20for%20MySQL%20or%20Azure%20Database%20for%26nbsp%3BMariaDB%20using%20PhpMyAdmin%20in%20a%20WAMP%20environment.%3C%2FP%3E%0A%3CP%3EAfter%26nbsp%3Bseveral%20tests%20it%20was%20very%20simple%20to%20configure%20it.%20Just%20only%20we%20need%20to%20modify%20the%20configuration%20file%20of%20PhpMyAdmin.%3C%2FP%3E%3C%2FLINGO-TEASER%3E

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!!