Hi everybody,
I've just started migrating my Prestashop from Ionos 1&1 to Digital Ocean Vps.
But I'm having an issue, when I try to connect to my website with my public ip adress of my Vps, it doesn't work.
It show me an error 500 and in the logs i've got this :
*ERROR* v1.7.7.2 Link to database cannot be established: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known at line 136 in file classes/db/DbPDO.php
Here is my parameters.php file :
<?php return array (
'parameters' =>
array (
'database_host' => 'localhost',
'database_port' => '',
'database_name' => '[thenameofmydatabase],
'database_user' => '[thenameofmyuser]',
'database_password' => '[thepassword]t',
'database_prefix' => 'miib_',
'database_engine' => 'MySQL',
'mailer_transport' => 'smtp',
'mailer_host' => '127.0.0.1',
'mailer_user' => NULL,
'mailer_password' => NULL,
'secret' => '[itsasecret]',
'ps_caching' => 'CacheMemcache',
'ps_cache_enable' => false,
'ps_creation_date' => '2021-01-11',
'locale' => 'en-US',
'use_debug_toolbar' => true,
'cookie_key' => '[itsasecret]',
'cookie_iv' => '[itsasecret]',
'new_cookie_key' => '[itsasecret]',
),
);
I tried many other parameters as replacing my database host by 127.0.0.1, or my server ip adress, I modified my database engine, but I'm not sure it's good
I tried with and without the 3306 port and even with all of that it doesn't work.
I've already tried to insert a big error in my parameters.php file to see if it was read and it is.
My phpAdmin Panel is saying this :
Apache/2.4.41 (Ubuntu)
Version du client de base de données : libmysql - mysqlnd 7.4.3
Extension PHP : mysqli curl mbstring
Version de PHP : 7.4.3
Serveur : Localhost via UNIX socket
Type de serveur : MySQL
Connexion au serveur : SSL n'est pas utilisé
Version du serveur : 8.0.23-0ubuntu0.20.04.1 - (Ubuntu)
Version du protocole : 10
Utilisateur : secret
Jeu de caractères du serveur : UTF-8 Unicode (utf8mb4)
I really need some help
I'm asking myself that :
Maybe issue is coming directly from my ps_domain information in my database, even if I've already modified it, but if my ps_domain was wrong, should the database could connect and the error would be an other one ?
Or other possibility, my database_engine informations is wrong, how can I verify this ?
Then, how can I found my database_host because the issue seems to be coming from this.
I've already grant permissions on the user that I'm trying to connect to the database.
I've setup my server following these tuto :
Initial Server Setup for Ubuntu
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04
Install LAMP on Ubuntu
Install phpmyadmin on Ubuntu
For version 20.04
I really need help on this