Link to home
Start Free TrialLog in
Avatar of pskeens
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.
Avatar of oobayly
oobayly
Flag of United Kingdom of Great Britain and Northern Ireland image

A couple of problems doing this:
  1. 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?
  2. 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
  3. It appears that you can't use variables when using the SET PASSWORD statement, so that method is out
Avatar of pskeens
pskeens

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
Avatar of pskeens

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
Avatar of oobayly
oobayly
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial