15 |
flush-engine-log flush-general-log flush-slow-log |
flush-engine-log flush-general-log flush-slow-log |
16 |
fi |
fi |
17 |
endscript |
endscript |
18 |
|
diff -Nur --no-dereference smeserver-mysql-2.7.0.old/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize smeserver-mysql-2.7.0/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize |
19 |
|
--- smeserver-mysql-2.7.0.old/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize 2022-03-12 00:27:43.000000000 -0500 |
20 |
|
+++ smeserver-mysql-2.7.0/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize 2022-03-13 01:24:53.334000000 -0500 |
21 |
|
@@ -34,8 +34,11 @@ |
22 |
|
fi |
23 |
|
exit $ret |
24 |
|
fi |
25 |
|
- # set root password |
26 |
|
- /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password |
27 |
|
+ # set root password , 104 and above have a different syntax and allow root passwordless access |
28 |
|
+ if [ !!!VER!!! -le 103 ] |
29 |
|
+ then |
30 |
|
+ /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password |
31 |
|
+ fi |
32 |
|
# upgrade does not need to be run on a fresh datadir |
33 |
|
#echo "5.7.24" >"$datadir/mysql_upgrade_info" |
34 |
|
# In case we're running as root, make sure files are owned properly |
35 |
|
@@ -46,7 +49,10 @@ |
36 |
|
/sbin/e-smith/expand-template /etc/e-smith/sql/init!!!VER!!!/00_restore_dumped_dbs |
37 |
|
fi |
38 |
|
else |
39 |
|
- # else we set root password anyway ! just to be sure ! |
40 |
|
- /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password |
41 |
|
- |
42 |
|
+ # else we set root password anyway ! just to be sure ! 104 and above have a different syntax and allow root passwordless access |
43 |
|
+ if [ !!!VER!!! -le 103 ] |
44 |
|
+ then |
45 |
|
+ /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password |
46 |
|
+ fi |
47 |
|
+ exit 0 |
48 |
|
fi |
49 |
diff -Nur --no-dereference smeserver-mysql-2.7.0.old/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ smeserver-mysql-2.7.0/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ |
diff -Nur --no-dereference smeserver-mysql-2.7.0.old/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ smeserver-mysql-2.7.0/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ |
50 |
--- smeserver-mysql-2.7.0.old/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ 2022-03-12 16:39:10.000000000 -0500 |
--- smeserver-mysql-2.7.0.old/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ 2022-03-12 16:39:10.000000000 -0500 |
51 |
+++ smeserver-mysql-2.7.0/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ 2022-03-13 21:14:10.966000000 -0400 |
+++ smeserver-mysql-2.7.0/rootscl/etc/e-smith/templates/etc/phpMyAdmin/config.inc.php/11configMysql_VER_ 2022-03-13 21:14:10.966000000 -0400 |
70 |
then |
then |
71 |
exit_value=0 |
exit_value=0 |
72 |
HOME=/root |
HOME=/root |
73 |
|
diff -Nur --no-dereference smeserver-mysql-2.7.0.old/createlinks smeserver-mysql-2.7.0/createlinks |
74 |
|
--- smeserver-mysql-2.7.0.old/createlinks 2022-03-12 16:41:41.000000000 -0500 |
75 |
|
+++ smeserver-mysql-2.7.0/createlinks 2022-03-14 00:59:46.386000000 -0400 |
76 |
|
@@ -113,6 +113,7 @@ |
77 |
|
templates2events("/etc/my.cnf", $event); |
78 |
|
templates2events("/root/.my.cnf", $event); |
79 |
|
templates2events("/var/lib/mysql/set.password", $event); |
80 |
|
+templates2events("/var/lib/mysql/set.password2", $event); |
81 |
|
templates2events("/etc/phpMyAdmin/config.inc.php", $event); |
82 |
|
templates2events("/etc/opt/rh/rh-mariadb$_/my.cnf", $event); |
83 |
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb$_-mariadb"); |
84 |
diff -Nur --no-dereference smeserver-mysql-2.7.0.old/root/etc/e-smith/templates/var/lib/mysql/set.password smeserver-mysql-2.7.0/root/etc/e-smith/templates/var/lib/mysql/set.password |
diff -Nur --no-dereference smeserver-mysql-2.7.0.old/root/etc/e-smith/templates/var/lib/mysql/set.password smeserver-mysql-2.7.0/root/etc/e-smith/templates/var/lib/mysql/set.password |
85 |
--- smeserver-mysql-2.7.0.old/root/etc/e-smith/templates/var/lib/mysql/set.password 2022-03-11 10:32:13.000000000 -0500 |
--- smeserver-mysql-2.7.0.old/root/etc/e-smith/templates/var/lib/mysql/set.password 2022-03-11 10:32:13.000000000 -0500 |
86 |
+++ smeserver-mysql-2.7.0/root/etc/e-smith/templates/var/lib/mysql/set.password 2022-03-13 22:32:50.035000000 -0400 |
+++ smeserver-mysql-2.7.0/root/etc/e-smith/templates/var/lib/mysql/set.password 2022-03-14 00:55:17.357000000 -0400 |
87 |
@@ -3,9 +3,20 @@ |
@@ -6,6 +6,7 @@ |
88 |
|
$OUT .= "use mysql;\n"; |
89 |
my $pw = esmith::util::LdapPassword(); |
$OUT .= "ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n"; |
90 |
|
$OUT .= "UPDATE user SET password=password('$pw') WHERE user='root';\n"; |
91 |
- $OUT .= "use mysql;\n"; |
+ $OUT .= "DELETE FROM db WHERE user='';\n"; |
92 |
- $OUT .= "ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n"; |
$OUT .= "DELETE FROM user WHERE user='';\n"; |
|
- $OUT .= "UPDATE user SET password=password('$pw') WHERE user='root';\n"; |
|
|
- $OUT .= "DELETE FROM user WHERE user='';\n"; |
|
|
+ $OUT .= "DELIMITER //\n"; |
|
|
+ $OUT .= "use mysql //\n"; |
|
|
+ $OUT .= "SET \@vers := (SELECT REPLACE(SUBSTRING( \@\@VERSION , 1 , LOCATE( '.' , \@\@VERSION, LOCATE( '.' , \@\@VERSION )+1 ) ), '.','' ) ) //\n"; |
|
|
+ $OUT .= "BEGIN NOT ATOMIC \n"; |
|
|
+ $OUT .= "IF \@vers < 104 THEN \n"; |
|
|
+ $OUT .= " ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n"; |
|
|
+ $OUT .= " UPDATE user SET password=password('$pw') WHERE user='root';\n"; |
|
|
+ $OUT .= " DELETE FROM db WHERE user='';\n"; |
|
|
+ $OUT .= " DELETE FROM user WHERE user='';\n"; |
|
|
+ $OUT .= "ELSE \n"; |
|
|
+ $OUT .= " SET PASSWORD FOR 'root'\@localhost = PASSWORD(\"$pw\"); \n"; |
|
|
+ $OUT .= "END IF; \n"; |
|
|
+ $OUT .= "END // \n"; |
|
|
+ $OUT .= "DELIMITER ; \n"; |
|
93 |
$OUT .= "FLUSH PRIVILEGES;\n"; |
$OUT .= "FLUSH PRIVILEGES;\n"; |
|
+ |
|
94 |
} |
} |
95 |
|
diff -Nur --no-dereference smeserver-mysql-2.7.0.old/root/etc/e-smith/templates/var/lib/mysql/set.password2 smeserver-mysql-2.7.0/root/etc/e-smith/templates/var/lib/mysql/set.password2 |
96 |
|
--- smeserver-mysql-2.7.0.old/root/etc/e-smith/templates/var/lib/mysql/set.password2 1969-12-31 19:00:00.000000000 -0500 |
97 |
|
+++ smeserver-mysql-2.7.0/root/etc/e-smith/templates/var/lib/mysql/set.password2 2022-03-14 00:54:10.293000000 -0400 |
98 |
|
@@ -0,0 +1,9 @@ |
99 |
|
+{ |
100 |
|
+ use esmith::util; |
101 |
|
+ |
102 |
|
+ my $pw = esmith::util::LdapPassword(); |
103 |
|
+ |
104 |
|
+ $OUT .= "use mysql;\n"; |
105 |
|
+ $OUT .= "SET PASSWORD FOR 'root'\@localhost = PASSWORD(\"$pw\"); \n"; |
106 |
|
+ $OUT .= "FLUSH PRIVILEGES;\n"; |
107 |
|
+} |
108 |
|
diff -Nur --no-dereference smeserver-mysql-2.7.0.old/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password2 smeserver-mysql-2.7.0/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password2 |
109 |
|
--- smeserver-mysql-2.7.0.old/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password2 1969-12-31 19:00:00.000000000 -0500 |
110 |
|
+++ smeserver-mysql-2.7.0/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password2 2022-03-14 00:58:28.856000000 -0400 |
111 |
|
@@ -0,0 +1,3 @@ |
112 |
|
+PERMS=0400 |
113 |
|
+UID="root" |
114 |
|
+GID="root" |
115 |
|
diff -Nur --no-dereference smeserver-mysql-2.7.0.old/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize smeserver-mysql-2.7.0/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize |
116 |
|
--- smeserver-mysql-2.7.0.old/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize 2022-03-14 00:10:47.160000000 -0400 |
117 |
|
+++ smeserver-mysql-2.7.0/rootscl/sbin/e-smith/systemd/mariadb_VER_-initialize 2022-03-14 01:01:42.194000000 -0400 |
118 |
|
@@ -38,6 +38,8 @@ |
119 |
|
if [ !!!VER!!! -le 103 ] |
120 |
|
then |
121 |
|
/opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password |
122 |
|
+ else |
123 |
|
+ /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password2 |
124 |
|
fi |
125 |
|
# upgrade does not need to be run on a fresh datadir |
126 |
|
#echo "5.7.24" >"$datadir/mysql_upgrade_info" |
127 |
|
@@ -53,6 +55,9 @@ |
128 |
|
if [ !!!VER!!! -le 103 ] |
129 |
|
then |
130 |
|
/opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password |
131 |
|
+ else |
132 |
|
+ /opt/rh/rh-mariadb!!!VER!!!/root/usr/libexec/mysqld --bootstrap --datadir="$datadir" --user="mysql" < /var/lib/mysql/set.password2 |
133 |
|
fi |
134 |
|
+ |
135 |
|
exit 0 |
136 |
|
fi |