RopeADope Posted June 11, 2010 Share Posted June 11, 2010 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?" Quote Link to comment https://forums.phpfreaks.com/topic/204489-mysql-users-native-vs-table/ Share on other sites More sharing options...
premiso Posted June 11, 2010 Share Posted June 11, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/204489-mysql-users-native-vs-table/#findComment-1070791 Share on other sites More sharing options...
RopeADope Posted June 11, 2010 Author Share Posted June 11, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/204489-mysql-users-native-vs-table/#findComment-1070792 Share on other sites More sharing options...
Mchl Posted June 11, 2010 Share Posted June 11, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/204489-mysql-users-native-vs-table/#findComment-1070793 Share on other sites More sharing options...
RopeADope Posted June 11, 2010 Author Share Posted June 11, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/204489-mysql-users-native-vs-table/#findComment-1070854 Share on other sites More sharing options...
premiso Posted June 11, 2010 Share Posted June 11, 2010 Yes, you can. Because they are logged in on the code side (via php). MySQL sees it all as the database user setup for the account. That is how this site works, and countless others. Quote Link to comment https://forums.phpfreaks.com/topic/204489-mysql-users-native-vs-table/#findComment-1070876 Share on other sites More sharing options...
RopeADope Posted June 11, 2010 Author Share Posted June 11, 2010 Yes, you can. Because they are logged in on the code side (via php). MySQL sees it all as the database user setup for the account. That is how this site works, and countless others. Ah, I see. Thanks for clearing it up! Quote Link to comment https://forums.phpfreaks.com/topic/204489-mysql-users-native-vs-table/#findComment-1070890 Share on other sites More sharing options...
Mchl Posted June 11, 2010 Share Posted June 11, 2010 In other words: Users are logging into your application. Your application is logging into database Quote Link to comment https://forums.phpfreaks.com/topic/204489-mysql-users-native-vs-table/#findComment-1070903 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.