Solved

Update Database password with Trigger

Posted on 2009-03-30
4
270 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
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…

635 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