Jump to content

MySQL users, native vs table


RopeADope

Recommended Posts

Hi all.

 

My end result to my current project is basically a dashboard type deal, PHP driven with a MySQL database.  My question is--"When setting up users to generate info from the database, should these users be established in the MySQL DB, or should they be in a "users table" that PHP checks for authentication?"

 

I realize the question sounds like its asking the same thing twice, but I guess the essence of what I'm getting at is "MySQL.users vs MyDB.users?"

Link to comment
Share on other sites

MySQL.Users is for database access. You should only create users in there you want to give access to the database. You will want to setup your own users table for your php script.

 

The users will have access to the dashboard, as well as be able to enter/update/view data.  So for this purpose, would they need to be in MySQL.users or can I use a generic MySQL.users user with select/update/insert privileges?

Link to comment
Share on other sites

You'll probably be better off creating a users table in MySQL. The reason being, it's easier to create access rules based on application 'actions' a given user can perform instead of giving/forbidding them access to raw MySQL objects.

 

On the other hand, if your application is something like phpMyAdmin, that actually deals with access to MySQL objects, then perhaps using mysql.users IS indeed a better choice.

 

The users will have access to the dashboard, as well as be able to enter/update/view data.  So for this purpose, would they need to be in MySQL.users or can I use a generic MySQL.users user with select/update/insert privileges?

 

Link to comment
Share on other sites

You'll probably be better off creating a users table in MySQL. The reason being, it's easier to create access rules based on application 'actions' a given user can perform instead of giving/forbidding them access to raw MySQL objects.

 

On the other hand, if your application is something like phpMyAdmin, that actually deals with access to MySQL objects, then perhaps using mysql.users IS indeed a better choice.

 

Ah.  This isn't really a phpMyAdmin type program, its more an interface for viewing and working with data, not actual table structure or anything that in depth.  So my next question would be, can I have 50-100 users connected to the DB with a generic MySQL user at the same time?  For instance, can I have Fred, Ted, and Bob all logged into the dashboard and INSERT/UPDATE/VIEW data with the same MySQL user?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.