MySQL Forums
Forum List  »  Newbie

Re: How create new user and give privileges in MySql via query remotely.
Posted by: Phillip Ward
Date: May 20, 2015 08:18AM

Quote

I have an web application that needs create new users (by query) in the mysql and give privileges ...
Why??

IMHO, End User accounts should never be Database accounts.

Your application should use a single account for all communication with the database, the credentials for which never leave your code (no individual ever has access to them, other than you, of course).

Individual user "accounts" should be managed in your own [application] tables, and not in the MySQL system catalogs.

Here's one Good Reason why:
If you have database accounts for every user, how can a User ever reset their password if they forget it? They can't, because they can't log in to the application (because they can't connect to the database, because they've forgotten their password).
If the application manages ]the connection to] the database on their behalf, then any user can get as far as the "login page" at any time and be offered a "reset password" button should they need it.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: How create new user and give privileges in MySql via query remotely.
May 20, 2015 08:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.