Solved

Update Database password with Trigger

Posted on 2009-03-30
4
262 Views
Last Modified: 2012-05-06
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.
0
Comment
Question by:pskeens
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:oobayly
ID: 24022135
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
0
 
LVL 2

Author Comment

by:pskeens
ID: 24022281
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
0
 
LVL 2

Author Comment

by:pskeens
ID: 24022351
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.  
0
 
LVL 15

Accepted Solution

by:
oobayly earned 500 total points
ID: 24022411
That's how I tend to do it. The application has it's password to connect to the server, and I write my own authentication process.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now