Magento 2.4 安装不支持当前 RDBS 版本

Ali*_*han 0 mysql mariadb vagrant magento2 homestead

我通过命令行在 Vagrant 上安装 Magento 2.4 这是我得到的错误

Current version of RDBMS is not supported. Used Version: 10.5.8-MariaDB-1:10.5.8+maria~bionic. Supported versions: MySQL-8, MySQL-5.7, MariaDB-(10.2-10.4)
Run Code Online (Sandbox Code Playgroud)

这是我的 Homestead.yaml 中的配置


ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/code
      to: /home/vagrant/code

sites:
    - map: realityla.io
      to: /home/vagrant/code/realityla
    - map: lhm.bb
      to: /home/vagrant/code/lhm
    - map: magento.ee
      to: /home/vagrant/code/magento

databases:
    - homestead
features:
    - mysql: true
    - mariadb: true
    - postgresql: false
    - ohmyzsh: false
    - webdriver: false

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp
Run Code Online (Sandbox Code Playgroud)

如何仅更改我的 Magento 网站的 Mysql 或 MariaDB 版本

Nan*_*mar 5

Current version of RDBMS is not supported. Used Version: 10.6.4-MariaDB. Supported versions: MySQL-8, MySQL-5.7, MariaDB-(10.2-10.4)
Run Code Online (Sandbox Code Playgroud)

PHP 版本 7.4.27

nginx/1.21.5

服务器版本:10.6.4-MariaDB - Homebrew

macOS Catalina 版本 10.15.7 (19H1615)

Magento 开源 2.4.3-p1.zip

解决方案

纳米供应商/magento/framework/Test/Unit/DB/Adapter/SqlVersionProviderTest.php

 'MariaDB-10.6' => [
                ['version' => '10.6.4-MariaDB'],
                '10.6.'
            ],
Run Code Online (Sandbox Code Playgroud)

在公共函数executeDataProvider()中添加上面的行:最终函数将是这样的

/**
     * @return array
     */
    public function executeDataProvider(): array
    {
        return [
            'MariaDB-10.4' => [
                ['version' => '10.4.12-MariaDB-1:10.4.12+maria~bionic'],
                '10.4.'
            ],
            'MariaDB-10.2' => [
                ['version' => '10.2.31-MariaDB-1:10.2.31+maria~bionic'],
                '10.2.'
            ],
            'MariaDB-10.6' => [
                ['version' => '10.6.4-MariaDB'],
                '10.6.'
            ],
            'MySQL-5.7' => [
                ['version' => '5.7.29'],
                SqlVersionProvider::MYSQL_5_7_VERSION,
            ],
            'MySQL-8' => [
                ['version' => '8.0.19'],
                SqlVersionProvider::MYSQL_8_0_VERSION,
            ],
            'Percona' => [
                ['version' => '5.7.29-32'],
                SqlVersionProvider::MYSQL_5_7_VERSION,
            ],
        ];
    }
Run Code Online (Sandbox Code Playgroud)

纳米应用程序/etc/di.xml

第 1856 行将是这样的

<item name="MariaDB-(10.2-10.4)" xsi:type="string">^10\.[2-4]\.</item>
Run Code Online (Sandbox Code Playgroud)

像下面这样改变它

<item name="MariaDB-(10.2-10.6)" xsi:type="string">^10\.[2-6]\.</item>
Run Code Online (Sandbox Code Playgroud)