Skip to content

Commit 55e1397

Browse files
committed
B2B-2148: Can no longer install when my database name has a dash in it
1 parent 1647132 commit 55e1397

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)