Just trying to get prestashop running on azure, I've tried many times unfortunately without success, the issue is always the same:
Database Server is not found. Please verify the login, password and server fields (DbPDO)
I've tried:
- azure app service > web app + database
- azure app service > web app + database > then correcting the database collation to utf8mb4
- azure app service > web app + database > then creating a new database
- azure app service > web app + database > using service connectors
what works:
- I've created a simple PHP page that connects to the database and I can have a successful connections
now I'm trying to setup my own ubuntu server VM with LAMP stack, but I'm not an expert here so going through the process is really hard.
does anyone have any idea on solving the connection issue?
Solution:
- open azure portal https://portal.azure.com
- got to your resource group
-
go to your database server, from here we are doing 2 things
-
update server wide settings
- from the database server, on the left go to the "Server parameters"
- make sure the following settings have these values:
- character_set_server: UTF8MB4
- collation_server: UTF8MB4_0900_AI_CI
- require_secure_transport: OFF (THIS IS IMPORTANT)
-
update database specific settings
- from the database server, on the left go to the "Databases" section
- here you'll find the database that Azure created for you
-
be sure that:
- Character Set is utf8mb4
- Collation is:utf8mb4_general_ci
-
if the database created by azure doesn't have these settings:
- write down the database name
- delete the old database (you'll not be able to use it anyway)
-
create a new database clicking on "create" and create a new database with the settings above
- use the same name used for the old database
-
if you didn't use the same name you choose to:
- delete the database again, a create it again with the name used by azure
-
or give it a new name
-
if you give it a new name then now we need to update the web application to point to the new database:
- go to your web application inside the resource group
- on the left menu go to settings > configuration
- on the top a message will appear: "View and edit your application settings and connection strings from Environment variables. Click here to go to Environment Variables menu"
- click to see the environment variables
- update the AZURE_MYSQL_DBNAME variable with the name of the new database
-
if you give it a new name then now we need to update the web application to point to the new database:
- now on the prestashop installation page you MUST select to not use SSL
- then you'll be able to connect
-
update server wide settings