Sponsored Content
Special Forums UNIX and Linux Applications grant usage to users listed in a file Post 302242336 by ankimo on Wednesday 1st of October 2008 05:04:54 PM
Old 10-01-2008
i thought about this some more and wonder if this is a smarter solution. it seems closer, but i'd still love feedback if there is a better way:

Code:
while read user; do
   
  userid=$user
  passwd="changeme"
  print "grant usage on <database>.* to '"$user"' identified by '"$passwd"';"  >> grant_file

done < userid_file


mysql -BCNnqs --disable-pager -u<root> -p<password> <<EOJ
source /PATH/to/grant_file
flush privileges;
quit;

EOJ

 

10 More Discussions You Might Find Interesting

1. HP-UX

CVSWeb - Directories listed but files not listed

I am using CVSWeb on HPUnix. When i access it, all directories are listed but files are not listed. I am getting the error "NOTE: There are 51 files, but none matches the current tag. " in tomcat sevrer log i am getting the message "rlog warning: Missing revision or branch number after -r"... (0 Replies)
Discussion started by: ganesh
0 Replies

2. UNIX for Dummies Questions & Answers

memory usage : kernel, oracle, other users

Hello, I'm looking for a command or script that could permit me to know what is memory usage group by HP-UX kernel, oracle processes and other users (specific software). A command like 'top' but for all processes and not only for 12 max could be very useful Thanks in advance (4 Replies)
Discussion started by: thierryUX
4 Replies

3. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

4. UNIX for Advanced & Expert Users

any quicker way to list disc usage by users?

Hi: it takes a long time for "du -sh list_of_users" to give you the output. Is there a quicker way to get this info? Thanks! N.B. Phil (4 Replies)
Discussion started by: phil518
4 Replies

5. AIX

balance CPU usage between users

Hi! Is there any way to balance CPU usage between users on percentage basis? Something like Resource Manager in Oracle databases. Regards. ---------- Post updated at 02:17 PM ---------- Previous update was at 02:09 PM ---------- Workload Manager? ---------- Post updated at 03:44 PM... (0 Replies)
Discussion started by: bas_ua
0 Replies

6. UNIX for Dummies Questions & Answers

CPU usage restrictions for users?

I was wondering if there was a way to set resource usage per user. For example, if I use "grep -f <file1> <file2>" and the two files are very big it consumes a lot of resources. Onetime someone pinged me and asked what the hell I was doing and to kill it. Is there any way an SA can restrict... (7 Replies)
Discussion started by: MaindotC
7 Replies

7. Shell Programming and Scripting

Users and their storage usage

Hey, I'm trying to make a script that can list users and their storage usage in a file. Im trying to get it to where the format is: User xxkbs User2 xkb and so on. So far I figured out how to get the users, but I cannot figure out how to get the storage usage per user. This is what... (2 Replies)
Discussion started by: HakerDemon
2 Replies

8. AIX

High CPU Usage , users affected

Dear All, One production Server is affected by high usage. Application is slow now. Please guide me how to solve it? NMON Report shows full cpu usage. Here im posting some server details. bash-3.2# lparstat -i Node Name : ********* Partition Name ... (6 Replies)
Discussion started by: Thala
6 Replies

9. Shell Programming and Scripting

Space usage by top 5 users in a filesystem

I want to see top 5 users,who have occupied most amount of disk space in a filesystem. But not sure how to do it. I can get the usage for a particular user find . -user user -type f exec df -h {} \;|awk '{ s = s+$1 } END { print "Total used: ",s }' But how to get without specifying any user... (6 Replies)
Discussion started by: rka
6 Replies

10. Emergency UNIX and Linux Support

Usage by users

I would like to know how to capture the usage of CPU by each user. Is there a way to do this on AIX? Gaya (0 Replies)
Discussion started by: ggayathri
0 Replies
NNUSAGE(1m)															       NNUSAGE(1m)

NAME
nnusage - display nn usage statistics SYNOPSIS
nnusage [ -at ] DESCRIPTION
nnusage will extract the usage entries from the log file and calculate the total usage time for the current user, or for all nn users if -a is specified. When -t is used with the -a option, nnusage will list the users ordered after the total usage time. Otherwise, the output will be sorted according to user names. Since it is possible to suspend nn, or leave the terminal while nn is active, nn tries to be intelligent when it calculates the usage time so it will truly report the actual time spent on news reading. FILES
../Log The log file SEE ALSO
nn(1), nncheck(1), nngoback(1), nngrep(1), nntidy(1) nnacct(1m), nnadmin(1M), nnquery(1M), nnmaster(8) NOTES
If nn is compiled with ACCOUNTING turned on, then calls to nnusage are converted into equivalent calls to nnacct. The nn package must have been compiled with the STATISTICS option turned on to produce the usage entries in the log file. Only nn sessions longer than 5 minutes are registered in the log file. AUTHOR
Kim F. Storm, Texas Instruments A/S, Denmark E-mail: storm@texas.dk 4th Berkeley Distribution Release 6.6 NNUSAGE(1m)
All times are GMT -4. The time now is 05:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy