![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX and Linux Applications Discuss UNIX and Linux software applications. This includes SQL, Databases, Middleware, MOM, SOA, EDA, CEP, BI, BPM and similar topics. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how do I make dynamic parameter names? Or get the value of a parameter evaluated twi | Awanka | Shell Programming and Scripting | 2 | 04-19-2007 09:37 PM |
| How to delete the files from local host to remote host | krishna176 | SUN Solaris | 3 | 03-24-2007 04:48 PM |
| Password parameter | wweldin | UNIX for Dummies Questions & Answers | 1 | 06-28-2006 10:39 AM |
| host alias not working: host not found | FunnyCats | UNIX for Advanced & Expert Users | 4 | 05-13-2005 04:36 PM |
| QNX host cannot ping SCO host, vice versa | gavon | IP Networking | 2 | 08-20-2001 08:57 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
set mysql password with host parameter
hi, linux gurus...
i'm trying to write a script in ksh called ResetPass that allows a user to change mysql passwords. the script accepts user, password and host like this: ResetPass <user> <password> <host>. here's the code: ***************************************************** mysql -BCNnqs --disable-pager -u system -pmanager << EOJ use mysql; set @user = '${1-.}'; set @pass = '${2-.}'; set @host = '${3-.}'; update user set password=password(@pass) where user=@user and host=@host; flush privileges; quit EOJ ***************************************************** when i only use this bit... update user set password=password(@pass) where user=@user; ... it works. but when i add the part, "and host=@host", it no longer does. there's something clearly wrong with my syntax but i'm not sure what. the mysql manual itself, says to use this form: ***************************************************** UPDATE mysql.user SET Password=PASSWORD('newpass') WHERE User='bob' AND Host='%.loc.gov'; FLUSH PRIVILEGES; ***************************************************** if anyone can see what i'm doing wrong, i would appreciate your advice. thanks! ankimo |
![]() |
| Bookmarks |
| Tags |
| host, ksh, mysql, password, set |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|