Creating a MySQL database with the portal is extremely simple. As usual, you enter the server name, database name and the Admin's password. At the time I'm writing this post, it was not possible to use any CLI, but I'm sure it will be available shortly. For the ones who are not used at Database as Service in Azure, one thing you will need to do to get access to your database from your computer is white listed your IP. It's very easy to do from the Azure Portal, just select the Connection Security tab on the left menu and add your address. Oh! And don't forger to click the save button. ;)
During my tests, I've tried different applications (WordPress, Azure WebApp, custom on-premise app.) that use MySQL as backend database, I didn't notice any problem, and performance were great. It was just... simpler; no server to configure, no VM to configure, no update. The only "issue" I got was trying to connect Power BI Desktop to a MySQL, but I think it more related to the drivers since the service was still in early preview. I notified Microsoft, and I'm sure it will be available shortly.
Since it's been a while since I did some reel work with MySQL I didn't have any client install on my laptop. In fact, I had no idea which one I should take.
I knew we can run some CLI inside a Docker container with an interactive interface. So I decided to give it a try. A quick
docker search mysqlshows me that an image existed. Here are the steps to get setup.
First, let's download the image, and create an instance named
mySQLToolsof MySQL 8.0:
docker run --name mySQLTools --env "MYSQL_ROOT_PASSWORD=Passw0rd" -d mysql:8
Then using the
-itlet's bring the bash prompt to our terminal.
docker exec -it mySQLTools bash -l
Finally we connect to our client using the usual settings (note that you must have no space between -p and your password):
mysql -h _ServerName.database.windows.net_ -u _UserName@ServerName_ -p_MyPassword_ _DatabaseName_
Voila! That's all what it takes to get started. And by the way, it will also work great with a Azure SQL Database.
docker pull shellmaster/sql-cli docker run -it --rm --name=sqlTools shellmaster/sql-cli mssql -s ServerName.database.windows.net -u UserName@ServerName -p YourPassword -d DatabaseName -e