Warning: mysqli_connect(): (HY000/2002): An attempt was made to access a socket in a way forbidden by its access permissions
12,635
To get your connection string in a Web App with MySQL on CLearDB:
- select your service in Azure Portal
- click Settings
- select Application Settings and scroll down to Connection String and click in "Show connection string values"
copy the middle column of the table you will get something like:
Database=YOUR_DATABASE_NAME;Data Source=YOUR_HOSTNAME;User Id=YOUR_USERNAME;Password=YOUR_PASSWORD
That's it, copy and replace in your code!
Protip: you can ping YOUR_HOSTNAME and use the IP instead the HOSTNAME to improve speed ;)
Author by
user5786953
Updated on June 05, 2022Comments
-
user5786953 almost 2 years
For two days yet I trying to resolve this problem
Warning: mysqli_connect(): (HY000/2002): An attempt was made to access a socket in a way forbidden by its access permissions.
My hosting is Azure and he has very bad interface. Programming language is PHP, I have database in same resource group with domain, account data is correct. what I do incorrect?
line with problem
mysqli_connect($SERVER, $USER, $PASSWORD, $DATABASE);