Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #22

Open
andxu opened this issue Jul 12, 2021 · 0 comments
Open

Test #22

andxu opened this issue Jul 12, 2021 · 0 comments

Comments

@andxu
Copy link
Owner

andxu commented Jul 12, 2021

Login

az login
az account show

Prepare mysql database

export SUBSCRIPTION=$(az account show --query id --output tsv)
export RESOURCE_GROUP=migrate-javaee-app
export WEBAPP=migrate-petstore-andxu
export REGION=eastus

export DATABASE_SERVER=migrate-petstore-andxu
export DATABASE_ADMIN=andxu
export DATABASE_ADMIN_PASSWORD=secret


export MYSQL_SERVER_NAME=mysql-${DATABASE_SERVER}
export MYSQL_SERVER_ADMIN_LOGIN_NAME=${DATABASE_ADMIN}
export MYSQL_SERVER_ADMIN_PASSWORD=${DATABASE_ADMIN_PASSWORD}
export MYSQL_DATABASE_NAME=petstore

export MYSQL_SERVER_FULL_NAME=${MYSQL_SERVER_NAME}.mysql.database.azure.com
export MYSQL_CONNECTION_URL=jdbc:mysql://${MYSQL_SERVER_FULL_NAME}:3306/${MYSQL_DATABASE_NAME}?ssl=true\&useLegacyDatetimeCode=false\&serverTimezone=GMT
export MYSQL_SERVER_ADMIN_FULL_NAME=${MYSQL_SERVER_ADMIN_LOGIN_NAME}\@${MYSQL_SERVER_NAME}

export DEVBOX_IP_ADDRESS=167.220.255.76
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home

az mysql server create --resource-group ${RESOURCE_GROUP} \
    --name ${MYSQL_SERVER_NAME}  --location ${REGION} \
    --admin-user ${MYSQL_SERVER_ADMIN_LOGIN_NAME} \
    --admin-password ${MYSQL_SERVER_ADMIN_PASSWORD} \
    --sku-name GP_Gen5_32 \
    --ssl-enforcement Disabled \
    --version 5.7

az mysql server firewall-rule create --name allAzureIPs \
    --server ${MYSQL_SERVER_NAME} \
    --resource-group ${RESOURCE_GROUP} \
    --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0

az mysql server firewall-rule create --name myDevBox \
    --server ${MYSQL_SERVER_NAME} \
    --resource-group ${RESOURCE_GROUP} \
    --start-ip-address ${DEVBOX_IP_ADDRESS} --end-ip-address ${DEVBOX_IP_ADDRESS}

az mysql server configuration set --name wait_timeout \
    --resource-group ${RESOURCE_GROUP} \
    --server ${MYSQL_SERVER_NAME} --value 2147483

mysql -u ${MYSQL_SERVER_ADMIN_FULL_NAME}  -h ${MYSQL_SERVER_FULL_NAME} -P 3306 -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant