pskeens
asked on
Update Database password with Trigger
I have a table called tbl_users in my application. The passwords expire every 90 days in this application. When a user changes their password in the application I need to update the MySQL "user" table with the new password. Both DB's are on the same server so I'm guessing I need to create a trigger when the record is updated in "tbl_users" to update the "users" table?? I'm just not sure on how to go about this. Ideas? Thanks in advance.
A couple of problems doing this:
- All these users have to be given permission to alter the mysql user table. Do you really want them to be able to do that?
- You cannot call FLUSH PRIVILEGES in a trigger, so even if you grant access to the mysql user table, the changes can't be flushed
- It appears that you can't use variables when using the SET PASSWORD statement, so that method is out
ASKER
If each user has the right to update only it shouldnt be a problem. They will not see the tables or structure so I don't see a problem with the access grants.
Any ideas on how to accomplish this? thanks
Any ideas on how to accomplish this? thanks
ASKER
How about I use a "DUMMIE" password for the SQL server and make them all the same. This way when they do a ODBC Refresh it will use the dummie password just for connection purposes and will use the application password for application control.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.