I’ve checked the changes done from RC to 8.0. And the only change on the checkDBConnection step, was a change to provide the port (which allows setting a custom port).
As you can see from the log messages PDO is not being able to access the db
[2021-11-24 10:47:36] install.INFO: Running step: check-db-connection [] []
[2021-11-24 10:47:36] app.ERROR: An error occurred while checking the Database Host Connection SQLSTATE[HY000] [2005] Unknown MySQL server host ‘127.0.0.1:’ (-2) [] []
...
[2021-11-24 10:47:59] install.INFO: Running step: check-db-connection [] []
[2021-11-24 10:47:59] app.ERROR: An error occurred while checking the Database Host Connection SQLSTATE[HY000] [2005] Unknown MySQL server host ‘127.0.0.1:3306’ (-2) [] []
Some other questions to try to debug the problem:
Are you using CentOS? do you have selinux enabled? It has some options to block the db connections.
[2021-11-24 10:47:30] app.ERROR: An error occurred while checking the Database Host Connection SQLSTATE[HY000] [2005] Unknown MySQL server host ‘localhost:’ (-2) [] []
PHP 7.4
DB port 3306
I dont now CentOS selinux
this server is a shared service
It is working:
s84 ~ # telnet localhost 3306
Trying ::1…
Connected to localhost.
Escape character is ‘^]’.
a
5.5.5-10.3.31-MariaDB-cll-lve
Where is that line of code with the port maybe just remove the “:”
I tried that too, of course. It doesn’t work either
[2021-11-23 18:16:38] app.ERROR: An error occurred while checking the Database Host Connection SQLSTATE[HY000] [2005] Unknown MySQL server host ‘localhost:3306’ (-2) [] []
If you are comfortable with changing the code, please? could you try replacing the checkDBConnection method in core/backend/Install/LegacyHandler/InstallHandler.php, with:
public function checkDBConnection(array $inputArray): bool
{
$host = "mysql:host=" . $inputArray["db_host"];
if (!empty($inputArray["db_port"])) {
$host .= ":" . $inputArray["db_port"];
}
try {
new PDO(
$host . ";",
$inputArray['db_username'],
$inputArray['db_password']
);
} catch (PDOException $e) {
$this->logger->error('An error occurred while checking the Database Host Connection ' . $e->getMessage());
return false;
}
return true;
}
ERROR [app] An error occurred while checking the Database Host Connection SQLSTATE[HY000] [2005] Unknown MySQL server host '127.0.0.1:3306' (-2)
Connecting from command line works fine:
mysql -u suitecrm --password='qwerty' -h 127.0.0.1 -P 3306 suitecrm
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.5.11-MariaDB-alt2 (ALT Sisyphus)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [suitecrm]>
Running: check-install-lock
step: check-install-lock | status: done
Installer not locked. Proceeding with install
Running: check-db-connection
09:02:56 ERROR [app] An error occurred while checking the Database Host Connection SQLSTATE[HY000] [2003] Can’t connect to MySQL server on ‘127.0.0.1:3306’ (111)
step: check-db-connection | status: failed
Could not connect to db
Running: check-install-lock
step: check-install-lock | status: done
Installer not locked. Proceeding with install
Running: check-db-connection
09:03:12 ERROR [app] An error occurred while checking the Database Host Connection SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (111)
step: check-db-connection | status: failed
Could not connect to db
It went through with -H “127.0.0.1” and your correction, I forgot to start mariadb. But now, when I log in as admin/admin, it says “Error occurred while fetching metadata”.