Hello @abdul shakoor !
This issue is not related to firewall rules or MySQL authentication. What you’re seeing is a DNS resolution failure. In other words, Cloud Shell cannot translate sumradb.mysql.database.azure.com into an IP address.
The key detail is that the --name parameter in az mysql flexible-server connect expects only the server name, not the full FQDN. Example for a correct command:
az mysql flexible-server connect --admin-user sumradb --name sumradb
When you pass the full FQDN, the CLI appends .mysql.database.azure.com again, producing an invalid hostname that DNS cannot resolve.
If your Flexible Server is configured with private access only (inside a VNet), Cloud Shell (which runs in a Microsoft-managed VNet) will never be able to reach it. In that case, you have two options:
- Enable public access on the Flexible Server:
- Go to the Azure portal → Networking → confirm that Public access (allowed) is selected.
- If it’s set to Private access (VNet Integration), Cloud Shell cannot connect. You’ll need a VM in the same VNet.
- Use a Bastion host or jumpbox VM inside the VNet to connect.
On your PHP app: Access denied for user
This is a MySQL authentication problem, separate from the DNS issue. The error:
Access denied for user 'sumradb@sumradb'@'20.198.197.154'
This indicates that the server is reachable, but either the password is incorrect or the user mapping is invalid. To resolve this, you can try:
- Double-check that you’re using the admin password you set when creating the server.
- If you’ve reset the password in the portal, make sure your PHP app is updated with the new one.
Regarding the GRANT error (1410):
Flexible Server’s admin account is not a full MySQL SUPER user. It has elevated privileges but cannot use WITH GRANT OPTION. To create application users, use:
CREATE USER 'appuser'@'%' IDENTIFIED BY 'StrongPassword!';
GRANT ALL PRIVILEGES ON *.* TO 'appuser'@'%';
I hope this helps!