[LON-CAPA-cvs] cvs: doc /install/linux install.pl
raeburn
raeburn at source.lon-capa.org
Fri Mar 26 13:59:52 EDT 2021
raeburn Fri Mar 26 17:59:52 2021 EDT
Modified files:
/doc/install/linux install.pl
Log:
- In MySQL/Mariadb use of utf8mb4 character set results in "specified key
was too long" error for primary key in md5_*_parameter tables.
Index: doc/install/linux/install.pl
diff -u doc/install/linux/install.pl:1.73 doc/install/linux/install.pl:1.74
--- doc/install/linux/install.pl:1.73 Thu Mar 18 21:40:03 2021
+++ doc/install/linux/install.pl Fri Mar 26 17:59:52 2021
@@ -78,7 +78,7 @@
&mt('Stopping execution.')."\n";
exit;
} else {
- print LOG '$Id: install.pl,v 1.73 2021/03/18 21:40:03 raeburn Exp $'."\n";
+ print LOG '$Id: install.pl,v 1.74 2021/03/26 17:59:52 raeburn Exp $'."\n";
}
#
@@ -2047,7 +2047,7 @@
if ($callsub{'mysql'}) {
if ($dbh) {
&setup_mysql($callsub{'mysqlperms'},$dbh,$has_pass,
- $mysql_unix_socket,$has_lcdb);
+ $mysql_unix_socket,$has_lcdb,$distro);
} else {
print &mt('Unable to configure MySQL because access is denied.')."\n";
}
@@ -2518,10 +2518,20 @@
}
sub setup_mysql {
- my ($setup_mysql_permissions,$dbh,$has_pass,$mysql_unix_socket,$has_lcdb) = @_;
+ my ($setup_mysql_permissions,$dbh,$has_pass,$mysql_unix_socket,$has_lcdb,$distro) = @_;
my @mysql_lc_commands;
unless ($has_lcdb) {
- push(@mysql_lc_commands,"CREATE DATABASE loncapa");
+ my $createcmd = 'CREATE DATABASE loncapa';
+ if ($distro =~ /^sles(\d+)/) {
+ if ($1 > 11) {
+ $createcmd .= ' CHARACTER SET utf8 COLLATE utf8_general_ci';
+ }
+ } elsif ($distro =~ /^ubuntu(\d+)/) {
+ if ($1 > 16) {
+ $createcmd .= ' CHARACTER SET latin1 COLLATE latin1_swedish_ci';
+ }
+ }
+ push(@mysql_lc_commands,$createcmd);
}
push(@mysql_lc_commands,"USE loncapa");
push(@mysql_lc_commands,qq{
More information about the LON-CAPA-cvs
mailing list