There are two sample database options for you to use:
- Polls database : Use this schema to create a polls application
- Community tutorials from mysqltutorial.org - mysql sample database and also postgres version of the same database
You can use the runtime of your choice (Python, PHP, .NET , Node JS etc) to build using these samples. Note that this repository only contains sample databases schema with some data. It does not contain any application code.
Follow the steps below to install these scripts out on your server.
- You need an Azure subscription. Sign up for Free trial and you can get 12 months free with Azure Database for MySQL Flexilbe server.
- You need to install a client to install the schema and data. You can install Azure CLI or MySQL Client tool like mysql.exe or MYSQL Workbench.
- Install Azure CLI . If ou have Azure CLI installed , please run
az upgrade
to make sure you are suing the latest Azure CLI version. - Create Azure database for MySQL Flexible server with public access
az mysql flexible-server create --name mydemoserver --pubic-access all
- Import data using
execute
command.az mysql flexible-server execute -n mysqlservername -u adminuser -p "adminpassword" -f "path to pollsdb.sql"
Install MySQL command line client tool and then run the following command. Make sure to replace the server name , username and database name with the correct values . SSL is enforced by default hence --ssl-mode is required. You also need to download the public SSL certificate.
mysql -h mysqlservername.database.azurecom -u adminusername -p database_name --ssl-mode=REQUIRED --ssl-ca=DigiCertGlobalRootCA.crt.pem < pollsdb.sql
SSL can be turned off for the server. See how to disable SSL.
mysql -h mysqlservername.database.azurecom -u adminusername -p database_name < pollsdb.sql
Checkout this tutorial on how to connect with MySQL Workbench. You can copy and paste the script in the query window and execute it.
Azure Database for MySQL Flexible Server Documentation