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â.