rommmka
4/9/2020 - 2:34 PM

Installing Magento2 on MySQL 8.0

Add the code in file vendor/magento/framework/DB/Adapter/Pdo/Mysql.php line 1846 after line case 'smallint': add case 'smallint unsigned': and after line case 'int': add "case 'int unsigned':"

or full method code

protected function _getColumnTypeByDdl($column)
{
    switch ($column['DATA_TYPE']) {
        case 'bool':
            return Table::TYPE_BOOLEAN;
        case 'tinytext':
        case 'char':
        case 'varchar':
        case 'text':
        case 'mediumtext':
        case 'longtext':
            return Table::TYPE_TEXT;
        case 'blob':
        case 'mediumblob':
        case 'longblob':
            return Table::TYPE_BLOB;
        case 'tinyint':
        case 'smallint':
        case 'smallint unsigned':
            return Table::TYPE_SMALLINT;
        case 'mediumint':
        case 'int':
        case 'int unsigned':
            return Table::TYPE_INTEGER;
        case 'bigint':
            return Table::TYPE_BIGINT;
        case 'datetime':
            return Table::TYPE_DATETIME;
        case 'timestamp':
            return Table::TYPE_TIMESTAMP;
        case 'date':
            return Table::TYPE_DATE;
        case 'float':
            return Table::TYPE_FLOAT;
        case 'decimal':
        case 'numeric':
            return Table::TYPE_DECIMAL;
    }
}

Then run command filled with your data:

bin/magento setup:install --base-url=http://magento2.test --db-host=localhost --db-name=magento2 --db-user=root --db-password=123654 --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1