Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Update Database password with Trigger

Posted on 2009-03-30
4
Medium Priority
?
274 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 2000 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
What we learned in Webroot's webinar on multi-vector protection.
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

718 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