This example assumes you have previously completed the following examples:
- Create an Azure Resource Group
- Create an Azure Database for MySQL
- Install curl
- Open MySQL server firewall to your IP address
- Install mysql client
To load the MySQL database with data execute the following command lines to connect to the database:
export MYSQL_DNS_NAME=`az mysql server show \
--resource-group $RESOURCE_GROUP \
--name $MYSQL_NAME \
--query fullyQualifiedDomainName \
--output tsv`
export MYSQL_CLIENT_USERNAME="$MYSQL_USERNAME@$MYSQL_NAME"
mysql -h $MYSQL_DNS_NAME -u $MYSQL_CLIENT_USERNAME -p$MYSQL_PASSWORD
Then use the following command line to load the load.sql
file into the
database:
source load.sql;
And to exit the mysql
tool use the following command line:
\q
Do NOT forget to remove the resources once you are done running the example.
- Azure Database for MySQL Documentation
- Migrate to Azure Database for MySQL
- Minimal downtime migration
- Query data using Java
- Manage Azure Database for MySQL servers
1m