Azure Mysql in app, error #2002
In the Azure WEB APP , MYSQL IN APP, you get this error
azurewebsites.net/phpMyAdmin/
Erreur :
#2002 - An attempt was made to access a socket in a way forbidden by its access permissions.
— The server is not responding (or the local server's socket is not correctly configured).
mysqli_real_connect(): (HY000/2002): An attempt was made to access a socket in a way forbidden by its access permissions.
— The server is not responding (or the local server's socket is not correctly configured).
mysqli_real_connect(): (HY000/2002): An attempt was made to access a socket in a way forbidden by its access permissions.
The solution is
Currently the web app is
hosted on Standard App Service Plan. In order to restore the site from snapshot
we need to scale up the app service plan to Premium. You can scale down the App
Service Plan to Standard after the site restoration is complete.
Restore the site from Snapshot:
Also, please turn on the Always_On on Azure Portal. The reason for this is, when the web App doesn’t receive any requests for a certain time the machine shuts down automatically and starts again whenever there is a request. In this case the request takes longer to respond, as the machine should be started first and then serve the request. Enabling ‘Always On’ prevents the machine from shutdown.
Restore the site from Snapshot:
·
Create
a new empty deployment slot in the web app
·
Currently
this web app is in Standard App Service Plan
·
Scale
up the App Service Plan to Premium (you can Scale Down the ASP after completion
of restore)
·
Refresh
the browser
·
On
the Settings page of your app in the Azure portal, click Backups to display the
Backups page. Then click Restore under the Snapshot(Preview) section.
·
In
the Restore page, select the snapshot to restore.
·
Choose
the time of the backup which you want to restore
·
Specify
the destination for the app (Select the deployment which you have created
earlier) restore in Restore destination.
·
Click
OK
·
When
the restore is done, swap the slot with the production app
Also, please turn on the Always_On on Azure Portal. The reason for this is, when the web App doesn’t receive any requests for a certain time the machine shuts down automatically and starts again whenever there is a request. In this case the request takes longer to respond, as the machine should be started first and then serve the request. Enabling ‘Always On’ prevents the machine from shutdown.