@Akshay-8028
To check if the port is accessible from on public IP, can you try this link and check if the port is open.
And if you see that the 3306 port is open, then please check the IP binding in /etc/mysql/my.cnf
, you should bind the server external IP address and not the local bind-address 127.0.0.1
Please 'Accept as answer' if the provided information is helpful, so that it can help others in the community looking for help on similar topics.