How to deploy and use MySQL from the Azure Marketplace
MySQL is a popular open source relational database especially for those building on the LAMP stack (aka Linux, Apache, MySQL, Perl/PHP/Python). Installing MySQL on your Linux server can be done manually by following these instructions and running sudo apt-get install mysql-server
and configuring your system as needed.
However, there is an even easier way, which is to deploy a pre-configured, ready to run image for running MySQL on Microsoft Azure from BitNami.
Step 1: Deploy MySQL from Azure Marketplace
- Navigate to portal.azure.com
- Click
+ New
- Search for "MySQL" in the search box & submit
- Click
MySQL
byBitnami
- Click
Create
Step 2: Configure the Virtual Machine
MySQL like many solutions in the Azure Marketplace is a pre-configured virtual machine image, so you will need to define what kind of VM you need.
- Basics: Configure basic settings
- Enter a
Name
for the Virtual Machine - Enter a
User name
for the default admin/root account - Select your preferred
Authentication type
& enter apassword
orSSH public key
- Select the
subscription
to deploy the VM in.- More often than not you will not need to change this.
- For
Resource Group
select an existing one (if this deployment is related to previous resources in Azure) or create a new one.- Not sure what a Resource Group is? A resource group is a container that holds related resources for an application. The resource group could include all of the resources for an application, or only those resources that are logically grouped together. Read more about resource groups.
- Select a
Location
for the virtual machine
- Enter a
- Size: Choose virtual machine size
- The size of your VM depends greatly on how often your MySQL server is queried, how long those queries take, how big the database is and more. If this is for dev/test purposes A1-A2 is likely good enough. If this is for production I would suggest looking at the D series of VMs or DS series if you need SSD for max disk performance.
- Settings: Configure optional features
- All the defaults here are likey fine if you are just getting started
- If however, you already have a web app or workload that needs to connect to the database be sure to deploy to the same vnet/subnet if possible.
- To learn more about Virtual Machines be sure to check out the documentation
- Click
OK
- All the defaults here are likey fine if you are just getting started
- Summary
- Click
OK
- Click
- Buy
- MySQL itself is free, however the VM it will be deployed on has a cost (based on the size and disk options you chose).
- Click
Purchase
In a few minutes you will have your new VM with MysQL already installed, network & endpoints configured and everything ready to get you going!
Step 3: Logging into the VM
- Use SSH to log into your server
ssh <user>@<vm_public_ip>
- If you chose password you will be prompted for your password, otherwise if you chose to use your ssh public key you can specify it using
-i identity_file
. - Not sure about SSH? Click here to learn more on how to use SSH on Windows, Linux & Mac.
Step 4: Change the default password for MySQL
- Remember to change the default password for MySQL
mysqladmin -u root -p password
- You will be prompted to enter your existing password which is
bitnami
and to confirm your new password.
- You will be prompted to enter your existing password which is
- Verify your new password by logging into MySQL
mysql -u root -p
Next Steps
Need to know more about MySQL check out their documentation.
For more solutions that can be easily deployed check out the Azure Marketplace Gallery.
Follow me, @marc_gagne on Twitter.