Solved

Update Database password with Trigger

Posted on 2009-03-30
4
268 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
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…

751 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