skip to Main Content

I am installing Magento 2.4 on Vagrant through command line
here is the error I got

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)

and here is the configurations at my 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

How can I change the Mysql or MariaDB version for only my Magento Website

3

Answers


  1. Chosen as BEST ANSWER

    And here is how I found the solution, thanks,

    You Can modify the file: vendor/magento/framework/Test/Unit/DB/Adapter/SqlVersionProviderTest.php (Approximately Line 109 and add the MariaDB 10.5 Version to the Array:

    'MariaDB-10.5' => [ ['version' => '10.5.8-MariaDB-1:10.5.8+maria~bionic'], '10.5.' ], and update the file: app/etc/di.xml (approximately Line 1818):

    ^10.[2-5]. from:

    ^10.[2-4]. Now I will note, it is NOT advisable to mode core files, however if you want it to run on MariaDB 10.5, that's how you can tackle it.


    1. As a temporary fix you can apply a pull request(s) from this issue #31109: https://github.com/magento/magento2/issues/31109
      OR
    2. Wait till issue #31109 would be resolved and use MariaDB-10.4 for now
    Login or Signup to reply.
  2. 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)
    

    PHP Version 7.4.27

    nginx/1.21.5

    Server version: 10.6.4-MariaDB – Homebrew

    macOS Catalina Version 10.15.7 (19H1615)

    Magento Open Source 2.4.3-p1.zip

    Solution

    nano vendor/magento/framework/Test/Unit/DB/Adapter/SqlVersionProviderTest.php

     'MariaDB-10.6' => [
                    ['version' => '10.6.4-MariaDB'],
                    '10.6.'
                ],
    

    add above line in in public function executeDataProvider(): Final function will be like this

    /**
         * @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,
                ],
            ];
        }
    

    nano app/etc/di.xml

    Line no 1856 line will be something like this

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

    Change it like bellow

    <item name="MariaDB-(10.2-10.6)" xsi:type="string">^10.[2-6].</item>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search