Skip to content

Commit a037cdd

Browse files
joanheavattam06
authored andcommitted
B2B:2152: [Forward Port] [2.4-develop]: Can no longer install when my database name has a dash in it
- Added code changes for porting
1 parent e349be1 commit a037cdd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

setup/src/Magento/Setup/Validator/DbValidator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ public function checkDatabaseConnectionWithDriverOptions(
142142
private function checkDatabaseName(\Magento\Framework\DB\Adapter\AdapterInterface $connection, $dbName)
143143
{
144144
try {
145-
$connection->query("SHOW TABLES FROM $dbName")->fetchAll(\PDO::FETCH_COLUMN, 0);
145+
$query = sprintf("SHOW TABLES FROM `%s`", $dbName);
146+
$connection->query($query)->fetchAll(\PDO::FETCH_COLUMN, 0);
146147
return true;
147148
} catch (\Exception $e) {
148149
throw new \Magento\Setup\Exception(

0 commit comments

Comments
 (0)