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
#generating strong password file. #value 20 can be changed as per total user counting
seq 20 |while read line ; do cat /dev/urandom |tr -dc "[[:graph:]]" |head -c16;echo ; done > pass
#single file with userame(username list is given) and password
paste user pass > usercred
#creating user with readonly grant
cat usercred |while read a b ; do echo -e "CREATE USER '$a'@'%' IDENTIFIED BY '$b';\nGRANT SELECT ON database1.* TO '$a'@'%';\nGRANT SELECT ON database2.* TO '$a'@'%';\nFLUSH PRIVILEGES;\nSHOW GRANTS FOR '$a'@'%'; " ; done