Ignore:
Timestamp:
Apr 28, 2016, 10:13:00 AM (5 years ago)
Author:
mabarracus
Message:

support for mariadb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lliurex-sgdb/trunk/fuentes/install/usr/sbin/lliurex-sgbd

    r1291 r1298  
    7979mysql_version_upper(){
    8080    local ret=1;
    81     ver=$(mysql --version|egrep -o '[45]\.[0-9]+\.[0-9]+')
    82     if dpkg --compare-versions $ver gt "5.7.6"; then ret=0; fi;
     81    ver=$(mysqld --version 2>&1|egrep -o '[0-9]+\.[0-9]+\.[0-9]+')
     82    is_maria=$(mysqld --version 2>&1|grep -io 'mariadb'|wc -l)
     83    if [ $is_maria -gt 0 ]; then
     84        type_db='maria';
     85    else
     86        type_db='mysql';
     87    fi
    8388   
     89    if [ "$type_db" = "maria" ]; then
     90        ret=0
     91    else
     92        if dpkg --compare-versions $ver gt "5.7.6"; then ret=0; fi;
     93    fi
     94
     95
    8496    if [ $debug -eq 1 ]; then
    8597        if [ $ret -eq 0 ]; then
    86             echo "Compare versions: Detected new mysql > 5.7.6"
     98            echo "Compare versions: Detected $type_db version $ver (mysql > 5.7.6 new user tables)"
    8799        else
    88             echo "Compare versions: Detected old mysql < 5.7.6"
     100            echo "Compare versions: Detected $type_db version $ver (mysql < 5.7.6)"
    89101        fi
    90102    fi
Note: See TracChangeset for help on using the changeset viewer.