[LON-CAPA-cvs] cvs: doc(version_2_11_X) /install/linux install.pl

raeburn raeburn at source.lon-capa.org
Tue Feb 19 14:24:28 EST 2019


raeburn		Tue Feb 19 19:24:28 2019 EDT

  Modified files:              (Branch: version_2_11_X)
    /doc/install/linux	install.pl 
  Log:
  - For 2.11
    Backport 1.50, 1.51, 1.52
  
  
Index: doc/install/linux/install.pl
diff -u doc/install/linux/install.pl:1.45.2.1 doc/install/linux/install.pl:1.45.2.2
--- doc/install/linux/install.pl:1.45.2.1	Sat Feb 16 16:19:11 2019
+++ doc/install/linux/install.pl	Tue Feb 19 19:24:28 2019
@@ -75,7 +75,7 @@
           &mt('Stopping execution.')."\n";
     exit;
 } else {
-    print LOG '$Id: install.pl,v 1.45.2.1 2019/02/16 16:19:11 raeburn Exp $'."\n";
+    print LOG '$Id: install.pl,v 1.45.2.2 2019/02/19 19:24:28 raeburn Exp $'."\n";
 }
 
 #
@@ -1953,8 +1953,9 @@
 sub setup_mysql_permissions {
     my ($dbh,$has_pass, at mysql_lc_commands) = @_;
     my ($mysqlversion,$mysqlsubver,$mysqlname) = &get_mysql_version();
-    my ($usesauth,$hasauthcol, at mysql_commands);
+    my ($usesauth,$is_mariadb,$hasauthcol, at mysql_commands);
     if ($mysqlname =~ /^MariaDB/i) {
+        $is_mariadb = 1;
         if ($mysqlversion >= 10.2) {
             $usesauth = 1;
         } elsif ($mysqlversion >= 5.5) {
@@ -1968,8 +1969,12 @@
         }
     }
     if ($usesauth) {
-        @mysql_commands = ("INSERT user (Host, User, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES('localhost','www','','','','')",
-                         "ALTER USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'");
+        @mysql_commands = ("INSERT user (Host, User, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES('localhost','www','','','','')");
+        if ($is_mariadb) {
+            push(@mysql_commands,"ALTER USER 'www'\@'localhost' IDENTIFIED BY 'localhostkey'");
+        } else {
+            push(@mysql_commands,"ALTER USER 'www'\@'localhost' IDENTIFIED WITH mysql_native_password BY 'localhostkey'");
+        }
     } elsif ($hasauthcol) {
         @mysql_commands = ("INSERT user (Host, User, Password, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES('localhost','www',password('localhostkey'),'','','','');");
     } else {
@@ -2024,7 +2029,7 @@
             }
         }
         if ($got_passwd) {
-            my (@newpass_cmds) = &new_mysql_rootpasswd($newmysqlpass,$usesauth);
+            my (@newpass_cmds) = &new_mysql_rootpasswd($newmysqlpass,$usesauth,$is_mariadb);
             push(@mysql_commands, at newpass_cmds);
         } else {
             print_and_log(&mt('Failed to get MySQL root password from user input.')."\n");
@@ -2054,10 +2059,15 @@
 }
 
 sub new_mysql_rootpasswd {
-    my ($currmysqlpass,$usesauth) = @_;
+    my ($currmysqlpass,$usesauth,$is_mariadb) = @_;
     if ($usesauth) {
-        return ("ALTER USER 'root'\@'localhost' IDENTIFIED BY '$currmysqlpass'",
-                "FLUSH PRIVILEGES;");
+        if ($is_mariadb) {
+            return ("ALTER USER 'root'\@'localhost' IDENTIFIED BY '$currmysqlpass'",
+                    "FLUSH PRIVILEGES;");
+        } else {
+            return ("ALTER USER 'root'\@'localhost' IDENTIFIED WITH mysql_native_password BY '$currmysqlpass'",
+                    "FLUSH PRIVILEGES;");
+        }
     } else {
         return ("SET PASSWORD FOR 'root'\@'localhost'=PASSWORD('$currmysqlpass')",
                 "FLUSH PRIVILEGES;");




More information about the LON-CAPA-cvs mailing list