[MUSIC].
>> Hi, and welcome back.
Now that you have a good understanding of
MySQL and Azure Database for MySQL.
Before we dig deeper into its features let's get our
hands dirty and try out Flexible Server ourselves.
This is going to be a demo-heavy video.
We're going to cover how to get
started with an Azure free account,
how to create a server using
portal CLI on templates and other tools,
and also how to connect to
this Flexible Server using tools like mysql.exe,
that's the command line or MySQL Workbench.
First, let's get started by creating an
Azure Database for MySQL using the Azure portal.
We'll also look at the portal experience
that is there for the MySQL Flexible Server.
Go to the Azure portal, portal.azure.com, sign in to it.
If you don't have an Azure subscription, the best way
to get started is to create your Azure free account.
In the free account you actually get MySQL free
for up to 12 months and a lot of other features as well.
To see what services are free for you,
you just have to search free services in
the Azure portal and you can get the whole list of services.
You can see Azure Database for MySQL written
here up to 750 hours per month
of burstable B1MS compute
instance and add on 32GB of storage every month,
these are the other services that are available for you.
To get started for creating Azure Database for MySQL,
all you need to do is search for Azure Database for MySQL servers,
click on "Create" and it will land to this page where you'll get
to choose the deployment option.
The first option is Flexible server which is
usually the most recommended one for production workloads.
Then we also have Single server,
which is best for existing applications
that are already using Single server.
Let's create a Flexible server for now.
You need to fill in subscription details first.
You can either create a new resource group or use
a resource group that is already
existing like I have created one for myself.
Then you need to give your server name,
and this needs to be a unique server name across Azure.
There are also a couple of other rules that need to be
followed and make sure
that the name is available before you go ahead.
Once it is ready, you can choose your region,
the region that is closest to you,
and just the workload type.
If you are testing or
developing small projects than the development
one or if it's a large production
one or small and medium production workload,
you get to choose the workload type accordingly and your
computer and storage will change for each workload.
You can also configure the computer storage to
change from burstable to general purpose to memory optimized,
all these will be discussed in the upcoming episodes.
For now we will choose B1MS because that's also available
for free for you and then choose a storage site,
you can keep it up to 20GB or 32GB for now.
There are a lot of other options to choose from as
well but we'll cover more about these in the upcoming episodes.
For now, just click on "Save"
and choose the "Availability Zone", MySQL version.
Let the high availability and other options be
default for now and just
put in your username that you will
use to access the MySQL Flexible server going forward.
Now the password is also something that you must remember,
if you forget it you will have to reset it altogether.
So put in your password, confirm the password, and move
on to the next step, that is networking.
In networking you have to choose
a connectivity method, public or private.
In this we will choose public access,
there are a few allowed IP addresses
through which you can connect to the service,
add your current IP address
if you want to connect from your system to the server
and add some tags for
the server and then go on to create by reviewing the server once.
The estimated server creation time is around five minutes.
Just give a look through of all the server features that you
have selected and click on "Create".
You can see in the notification section now that the deployment
has been initiated and you will be
notified as soon as the deployment is completed.
Let's go to the resource for now.
This is the overview pane for the MySQL Flexible server.
You have a lot of details and tabs around,
the first and foremost the server name,
the server admin login name, configuration,
location, resource group, and so on.
Below you also have a list of
resources that can help you get started.
You can refer to any of these documentations to start
configure networking, connecting to it,
configure your database to schedule maintenance,
to tune the server parameters for performance,
backup, restore, and advanced features
like high availability and replication.
On the top, you can also see
a couple of options to stop the server,
restart the server, or even reset
your password in case you have forgotten it.
Now let's go on to look at
the other panes like compute and storage.
You can verify your compute storage, change it,
look at the networking, and make sure
that the firewall rules are up to date,
you can change it any time.
You can look at the different databases that are there,
these are the system databases,
look at connection strings that you'll use for each of
the applications to connect to MySQL Flexible server,
server parameters that you will do, replication,
functionality, maintenance, backup, restore, and so on.
You also have monitoring and help
and troubleshooting section of the pane.
But there's also one interesting feature that is to diagnose
and solve problems feature within
the server where you can actually look
at if there is any health related issues found
or if any resources
that you need to use to troubleshoot the server.
For example, if you have a issue with
creating a server then all you need
to do is choose the right option,
for example server here and you
get a list of all the top issues that
are probably seen and recommendations to
make sure that your server creation gets successful.
This ends the overview of
all the different options that are there
in the Azure portal for you.
Next, let's go on to connect to
MySQL Flexible server using the MySQL Workbench.
First, let's get some connection information from the database.
Let's pick up the server name,
the admin login name, and also the password,
in case you forgot it, reset it
and get the newest password ready for you.
Then go to the "Networking" tab,
make sure that "Public Access" is selected and
the IP address that is of your servers is added here.
In case you want to connect from any of
the Azure services themselves then
just click on "Allow Public Access"
from any Azure service within Azure.
You can also add all the IP addresses,
but I wouldn't recommend it because it's not as secure.
Also download the SSL certificate to make
sure that you have a verified connection from your application.
Next, let's add a connection in the MySQL Workbench.
You need to specify a connection name,
then the host name that you just picked up from the Azure portal,
also the username that you have specified earlier.
The port remains 3306,
just click on "Okay" and let the connection get started.
You will now be prompted for entering
the password and once you enter the password,
if in case you meet with
a connection error it's usually because your username
and password is not right or because
your networking access control is not set correctly.
So make sure that that is in place before
you click on "The Connection".
Now, let us look at
the databases that are there in the MySQL server.
You can also look at the databases from the "Azure
Portal Experience" under the "Database" tab.
You can also use these to add and delete the custom databases.
Let's add and create a new one, let's name it demodb with
the UDF eight character set and click on "Save".
You can, of course, not delete the system databases,
but you can delete demodb, let's keep it as is for now.
Let's go back to MySQL Workbench and show databases
again and you will see that the demodb is updated here.
Use that database and let's also
create and insert some values just
to see the working of the database.
Let's do a select start to view the values in the table.
Next, let's connect to
MySQL Flexible Server using MySQL command line.
You have to download and install the command line,
I already have it ready in my Windows system.
Use the MySQL command,
specify the hostname, username,
password, and the SSL certificate that
you downloaded earlier and click on
"Enter" then you will have to enter
the password and you will be ready to connect directly.
You can do the same actions, show databases,
use the demodb as well as select start
from table and there you have it.
You can also create MySQL Flexible server using tools like CLI,
PowerShell, ARM templates, Bicep, Terraform, etc.
In this demo video,
we will just look at creating a flexible server using
CLI and also look at a sample ARM template for server creation.
You can either run CLI directly
from Azure Portal in the Azure Cloud Shell.
This is typically easier,
you don't have to login, and it gives a great experience as
well or you can install CLI
on your Windows Markowitz or Linux system.
Let's create a resource group by providing
its name and the location in which it needs to be provisioned.
The command to create it is just easy to
create and it typically gets provisioned within seconds.
Next, let's create the MySQL Flexible server itself.
For this the command is
az mysql flexible-server create and
it takes a couple of parameters to create it.
Here, we'll create a simple one
burstable B1MS 20GB storage database,
you need to provide the hostname,
resource group name, location,
username, password as well as the public access IP address.
This is actually my current IP and indeed,
I don't do it later on.
Let's wait for it to finish
provisioning just as we saw in the Azure portal,
it takes a couple of minutes and here we have it.
Now you can either use Azure CLI itself or
the Azure Portal to manage the server going forward.
There are a lot of commands and sample code that
is there in our documentation for you to refer to.
Next, let's look at a sample ARM template
to create MySQL Flexible server.
First you need to provide a couple of parameters
and then describe the resource that is Flexible Server,
its properties, its name, SKU, and all the other features
that you have seen already in the Azure Portal.
You can also create firewall rules
within the ARM template and databases as well.
Here are the resources that you can use.
There are a lot of quick starts tutorials as well
as samples in our documentation as well as our blog.
If you have any questions write to us at this email address.
Thank you and I hope you enjoyed this episode.
See you in the next.
[MUSIC]