You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DBBackup.sh
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,3 +15,9 @@ done
15
15
mysql -u $USER -p$PASSWORD -h $HOST --skip-column-names -A -e "SELECT CONCAT('CREATE USER ','\'',user,'\'@\'',host,'\'',' IDENTIFIED BY PASSWORD ','\'',authentication_string,'\';') from mysql.user;"> Users.sql
16
16
mysql -u $USER -p$PASSWORD -h $HOST --skip-column-names -A -e "SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') AS query FROM mysql.user WHERE user NOT IN ('root','pma','rdsadmin','mysql.sys')"| mysql -u $USER -p$PASSWORD -h $HOST --skip-column-names -A | sed 's/$/;/g'| sed 's/IDENTIFIED BY PASSWORD <secret>//g'>> Users.sql
0 commit comments