--- doc/install/linux/install.pl 2016/08/09 15:20:45 1.37 +++ doc/install/linux/install.pl 2017/03/29 21:00:44 1.40 @@ -72,7 +72,7 @@ if (!open(LOG,">>loncapa_install.log")) &mt('Stopping execution.')."\n"; exit; } else { - print LOG '$Id: install.pl,v 1.37 2016/08/09 15:20:45 raeburn Exp $'."\n"; + print LOG '$Id: install.pl,v 1.40 2017/03/29 21:00:44 raeburn Exp $'."\n"; } # @@ -450,11 +450,14 @@ sub check_mysql_running { } } elsif ($distro =~ /^fedora(\d+)/) { if ($1 >= 16) { + if ($1 >= 19) { + $mysqldaemon ='mariadb'; + } $process = 'mysqld'; $proc_owner = 'mysql'; $use_systemctl = 1; } - if ($1 >= 22) { + if ($1 >= 19) { $mysqldaemon ='mariadb'; } } elsif ($distro =~ /^(?:centos|rhes|scientific)(\d+)/) { @@ -577,7 +580,7 @@ sub chkconfig { $uses_systemctl{'memcached'} = 1; $uses_systemctl{'cups'} = 1; } - if ($version >= 22) { + if ($version >= 19) { $daemon{'mysql'} = 'mariadb'; } } elsif ($distro =~ /^(?:centos|rhes|scientific)(\d+)/) { @@ -1786,12 +1789,20 @@ CREATE TABLE IF NOT EXISTS metadata (tit sub setup_mysql_permissions { my ($dbh,$has_pass,@mysql_lc_commands) = @_; - my ($mysqlversion,$mysqlsubver) = &get_mysql_version(); + my ($mysqlversion,$mysqlsubver,$mysqlname) = &get_mysql_version(); my ($usesauth,@mysql_commands); - if (($mysqlversion > 5.7) || (($mysqlversion == 5.7) && ($mysqlsubver > 5))) { + if ($mysqlname =~ /^MariaDB/i) { + if ($mysqlversion >= 10.2) { + $usesauth = 1; + } + } else { + if (($mysqlversion > 5.7) || (($mysqlversion == 5.7) && ($mysqlsubver > 5))) { + $usesauth = 1; + } + } + if ($usesauth) { @mysql_commands = ("INSERT user (Host, User, ssl_cipher, x509_issuer, x509_subject) VALUES('localhost','www','','','')", - "ALTER USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'"); - $usesauth = 1; + "ALTER USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'"); } else { @mysql_commands = ("INSERT user (Host, User, Password) VALUES('localhost','www',password('localhostkey'));"); } @@ -1886,17 +1897,17 @@ sub new_mysql_rootpasswd { } sub get_mysql_version { - my ($version,$subversion); + my ($version,$subversion,$name); if (open(PIPE," mysql -V |")) { my $info = ; chomp($info); close(PIPE); - ($version,$subversion) = ($info =~ /(\d+\.\d+)\.(\d+)[\-\w]*,/); + ($version,$subversion,$name) = ($info =~ /(\d+\.\d+)\.(\d+)\-?(\w*),/); } else { print &mt('Could not determine which version of MySQL is installed.'). "\n"; } - return ($version,$subversion); + return ($version,$subversion,$name); } ###########################################################