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/mysql_root_passwd

    r1291 r1298  
    1212limit=10
    1313alive=2
     14type_db=""
    1415
    1516mysql_version_upper(){
    1617    local ret=1;
    17     ver=$(mysql --version|egrep -o '[45]\.[0-9]+\.[0-9]+')
    18     if dpkg --compare-versions $ver gt "5.7.6"; then ret=0; fi;
     18    ver=$(mysqld --version 2>&1|egrep -o '[0-9]+\.[0-9]+\.[0-9]+')
     19    is_maria=$(mysqld --version 2>&1|grep -io 'mariadb'|wc -l)
     20    if [ $is_maria -gt 0 ]; then
     21        type_db='maria';
     22    else
     23        type_db='mysql';
     24    fi
    1925   
     26    if [ "$type_db" = "maria" ]; then
     27        ret=0
     28    else
     29        if dpkg --compare-versions $ver gt "5.7.6"; then ret=0; fi;
     30    fi
     31
     32
    2033    if [ $debug -eq 1 ]; then
    2134        if [ $ret -eq 0 ]; then
    22             echo "Compare versions: Detected new mysql > 5.7.6"
    23         else
    24             echo "Compare versions: Detected old mysql < 5.7.6"
     35            echo "Compare versions: Detected $type_db version $ver (mysql > 5.7.6 new user tables)"
     36        else
     37            echo "Compare versions: Detected $type_db version $ver (mysql < 5.7.6)"
    2538        fi
    2639    fi
Note: See TracChangeset for help on using the changeset viewer.