How to install Magento by bypassing SHOW DATABASES privilege

Modified on:
bypass install magento show databases

"SHOW DATABASES" is disabled on Hostinger for security reasons. In order to install Magento you need to edit one of the scripts files in the installation folder to bypass the show databases privilege. Here's what you need to do:

1. Open your website's File Manager and navigate to setup/src/Magento/Setup/Validator/DbValidator.php 2. Right click the file via your File Manager and select Edit. Locate the line containing "$query = "SHOW DATABASES";". You will need to comment out the following lines (add a // at the beginning of each line) as shown in the example: 

{
// $query = "SHOW DATABASES";
// $accessibleDbs = $connection->query($query)->fetchAll(\PDO::FETCH_COLUMN, 0);
// foreach ($accessibleDbs as $accessibleDbName) {
// if ($dbName == $accessibleDbName) {
// return true;
// }
// }
// throw new \Magento\Setup\Exception(
// "Database '{$dbName}' does not exist "
// ."or specified database server user does not have privileges to access this database."
// );
}

  • 무제한 웹 사이트 수
  • 24/7 라이브 지원
  • 쉬운 웹 사이트 빌더
  • 2X WordPress 최적화 속도
  • 30 일 환불 보증
제한된 시간 거래를 잡아라!
3.900
00
원 /월
25,470원
3 개월 동안 11,700원
구하다 54%
시작하기