/[smeserver]/rpms/smeserver-mysql/sme10/smeserver-mysql-2.7.0-bz12145-backupuserprivileges.patch
ViewVC logotype

Diff of /rpms/smeserver-mysql/sme10/smeserver-mysql-2.7.0-bz12145-backupuserprivileges.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.1 by jpp, Sun Sep 1 04:21:50 2024 UTC Revision 1.2 by jpp, Thu Sep 5 14:04:25 2024 UTC
# Line 39  diff -Nur --no-dereference smeserver-mys Line 39  diff -Nur --no-dereference smeserver-mys
39  +# will also need to exclude mysql.user from restore in mariadb >= 103  +# will also need to exclude mysql.user from restore in mariadb >= 103
40  +# inspired by https://stackoverflow.com/a/56588240  +# inspired by https://stackoverflow.com/a/56588240
41  +# for mariadb 5.5 we replace authentication_string with Password  +# for mariadb 5.5 we replace authentication_string with Password
42  +mysql $@  -sNe  " \  +mysql -sNe  " \
43  +  SELECT \  +  SELECT \
44  +    CONCAT( 'CREATE USER \'', User, '\'@\'', Host, '\' IDENTIFIED BY \'', Password, '\'\;' ) AS User \  +    CONCAT( 'CREATE USER \'', User, '\'@\'', Host, '\' IDENTIFIED BY \'', Password, '\'\;' ) AS User \
45  +  FROM mysql.user \  +  FROM mysql.user \
46  +  WHERE \  +  WHERE \
47  +    User NOT LIKE 'mysql.%' AND CONCAT( User, Host ) <> 'rootlocalhost'  \  +    User NOT LIKE 'mysql.%' AND CONCAT( User, Host ) <> 'rootlocalhost'  \
48  +" >/home/e-smith/db/mysql/mysql.privileges.dump  +" >/home/e-smith/db/mysql/mysql.privileges.dump
49  +mysql  $@ -sNe " \  +mysql -sNe " \
50  +  SELECT \  +  SELECT \
51  +    CONCAT( '\'', User, '\'@\'', Host, '\'' ) as User FROM mysql.user \  +    CONCAT( '\'', User, '\'@\'', Host, '\'' ) as User FROM mysql.user \
52  +  WHERE \  +  WHERE \
# Line 54  diff -Nur --no-dereference smeserver-mys Line 54  diff -Nur --no-dereference smeserver-mys
54  +    AND CONCAT( User, Host ) <> 'rootlocalhost' \  +    AND CONCAT( User, Host ) <> 'rootlocalhost' \
55  +" | sort | while read u ;  +" | sort | while read u ;
56  + do echo "-- $u">> /home/e-smith/db/mysql/mysql.privileges.dump  + do echo "-- $u">> /home/e-smith/db/mysql/mysql.privileges.dump
57  + mysql $@  -sNe "show grants for $u" | sed 's/$/;/' >> /home/e-smith/db/mysql/mysql.privileges.dump  + mysql -sNe "show grants for $u" | sed 's/$/;/' >> /home/e-smith/db/mysql/mysql.privileges.dump
58   done   done
59  +echo >> /home/e-smith/db/mysql/mysql.privileges.dump  +echo >> /home/e-smith/db/mysql/mysql.privileges.dump
60  +echo "FLUSH PRIVILEGES;" >> /home/e-smith/db/mysql/mysql.privileges.dump  +echo "FLUSH PRIVILEGES;" >> /home/e-smith/db/mysql/mysql.privileges.dump
# Line 98  diff -Nur --no-dereference smeserver-mys Line 98  diff -Nur --no-dereference smeserver-mys
98  +# would allow compatible backup from mariadb <103 to mariadb >= 103  +# would allow compatible backup from mariadb <103 to mariadb >= 103
99  +# will also need to exclude mysql.user from restore in mariadb >= 103  +# will also need to exclude mysql.user from restore in mariadb >= 103
100  +# inspired by https://stackoverflow.com/a/56588240  +# inspired by https://stackoverflow.com/a/56588240
101  +/opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysql $@  -sNe  " \  +/opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysql -sNe  " \
102  +  SELECT \  +  SELECT \
103  +    CONCAT( 'CREATE USER \'', User, '\'@\'', Host, '\' IDENTIFIED BY \'', authentication_string, '\'\;' ) AS User \  +    CONCAT( 'CREATE USER \'', User, '\'@\'', Host, '\' IDENTIFIED BY \'', authentication_string, '\'\;' ) AS User \
104  +  FROM mysql.user \  +  FROM mysql.user \
105  +  WHERE \  +  WHERE \
106  +    User NOT LIKE 'mysql.%' AND CONCAT( User, Host ) <> 'rootlocalhost'  \  +    User NOT LIKE 'mysql.%' AND CONCAT( User, Host ) <> 'rootlocalhost'  \
107  +" >/home/e-smith/db/mariadb!!!VER!!!/mysql.privileges.dump  +" >/home/e-smith/db/mariadb!!!VER!!!/mysql.privileges.dump
108  +/opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysql  $@ -sNe " \  +/opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysql -sNe " \
109  +  SELECT \  +  SELECT \
110  +    CONCAT( '\'', User, '\'@\'', Host, '\'' ) as User FROM mysql.user \  +    CONCAT( '\'', User, '\'@\'', Host, '\'' ) as User FROM mysql.user \
111  +  WHERE \  +  WHERE \
# Line 113  diff -Nur --no-dereference smeserver-mys Line 113  diff -Nur --no-dereference smeserver-mys
113  +    AND CONCAT( User, Host ) <> 'rootlocalhost' \  +    AND CONCAT( User, Host ) <> 'rootlocalhost' \
114  +" | sort | while read u ;  +" | sort | while read u ;
115  + do echo "-- $u">> /home/e-smith/db/mariadb!!!VER!!!/mysql.privileges.dump  + do echo "-- $u">> /home/e-smith/db/mariadb!!!VER!!!/mysql.privileges.dump
116  + /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysql $@  -sNe "show grants for $u" | sed 's/$/;/' >> /home/e-smith/db/mariadb!!!VER!!!/mysql.privileges.dump  + /opt/rh/rh-mariadb!!!VER!!!/root/usr/bin/mysql -sNe "show grants for $u" | sed 's/$/;/' >> /home/e-smith/db/mariadb!!!VER!!!/mysql.privileges.dump
117   done   done
118  +echo >> /home/e-smith/db/mariadb!!!VER!!!/mysql.privileges.dump  +echo >> /home/e-smith/db/mariadb!!!VER!!!/mysql.privileges.dump
119  +echo "FLUSH PRIVILEGES;" >> /home/e-smith/db/mariadb!!!VER!!!/mysql.privileges.dump  +echo "FLUSH PRIVILEGES;" >> /home/e-smith/db/mariadb!!!VER!!!/mysql.privileges.dump


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed