phpMyAdmin on Windows Azure Web Sites

1. Create an empty site

First you’ll need to create a new site in Windows Azure. 10 free sites are allowed per subscription and phpMyAdmin will work fine on a free site. Create an empty site using “Quick Create” option in Windows Azure Portal:

2. Link the site with a MySql database

If you already have a MySql database or need to create one then use the Linked Resources page to link that database with your site.

Once the database is linked get the connection string by using the “View conneciton strings” link on the site’s dashboard page:

You will need the information from this connection string to logon to the database via phpMyAdmin. It will looks similar to this:
  1. Database=some-db-name;Data Source=some-hostname;User Id=some-username;Password=some-password  

3. Download and configure phpMyAdmin

Get the latest version of phpMyAdmin from the offical site. Extract it to some temporary location on your hard drive. Create a new file with name in the same directory where examples, js, libraries, setup and themes directories are. Paste the following into that file:
  1. <?php  
  2. $cfg['blowfish_secret'] = 'ba17c1ec07d65003';  // use here a value of your choice  
  3. $i = 0;  
  4. /* First server */  
  5. $i++;  
  6. /* Authentication type */  
  7. $cfg['Servers'][$i]['auth_type'] = 'cookie';  
  8. /* Server parameters */  
  9. $cfg['Servers'][$i]['host'] = 'some-hostname';  // Replace with value from connection string  
  10. $cfg['Servers'][$i]['connect_type'] = 'tcp';  
  11. $cfg['Servers'][$i]['compress'] = false;  
  12. $cfg['Servers'][$i]['extension'] = 'mysqli';  
  13. $cfg['Servers'][$i]['AllowNoPassword'] = false;  
  14. ?>  

5. Upload phpMyAdmin files to Windows Azure

Multiple upload methods are supported. I used FTP with FileZilla. FTP hostname and username can be obtained from the site’s dashboard page in management portal. Once you connected via FTP, upload all the files into the /site/wwwroot/ directory.

6. Logon to MySql database

Browse to the newly created site. You should see the phpMyAdmin logon page:

Use the User Id and Password from the connection string to logon.
Share on Google Plus

About h

Please leave your valuable comments !!
    Blogger Comment
    Facebook Comment


Post a Comment