Jump to content
|Topic||Stats||Last action by|
|Windows 9 and Windows 365 expected to See The Light Of Day||
|Samsung 840 EVO SSDs suffer from performance degradation||
|Microsoft has delayed the launch of the Xbox One in China||
|Great Find - Too Good to be True ?||
|Asus X83V Laptop Bios Password...||
Posted 04 January 2013 - 13:58
Posted 04 January 2013 - 14:01
Posted 04 January 2013 - 14:06
What do you mean unique mysql user per logged in user, what type of site is this?
Posted 04 January 2013 - 14:09
I mean, to create a MySQL user. The default user on a MySQL server is root. I would like to know if it would improve security having a separate user like "John" which would only access Joh_products and John_clients table and will have limited privileges like SELECT, DROP, UPDATE, INSERT commands.
This site, is on development right now, so everything can be modified. It's a receipt management website, which each of the users will have their own clients stats, number of purchases, receipts, etc.
Posted 04 January 2013 - 14:15
Posted 04 January 2013 - 14:21
Posted 04 January 2013 - 14:26
Posted 04 January 2013 - 14:28
Posted 04 January 2013 - 15:48
NEVER use the root account AT ALL once you've configured the MySQL server, make another account and grant it root-like permissions and ONLY use the root account as a last resort if something breaks to restore everything.
Yes use different accounts for different sites, one account for all clients on one site should be fine i.e. one account for this receipt tracking site, another account for a control panel site, etc.
There was no other way my logic could function.
I don't really see the point of having totally distinct tables for each user either. Seems like a lot of duplication and you'll end up with a massive amount of tables.
Posted 05 January 2013 - 06:34
I Googled a bit and found that there wasn't any problem having multiple tables. The thing is that it allows flexibility. I didn't see a good way on putting the client info, the receipt #, the quantity, price of the product purchased (because it has a variable price), the current product id, the tax, and whether it was paid, delivered or not. So I could fetch it in a productive way later on....
Posted 05 January 2013 - 06:44
Posted 05 January 2013 - 21:23
Posted 05 January 2013 - 21:33
Posted 05 January 2013 - 23:08
Multiple tables are fine, in fact you should be using multiple tables, but there's a much better and organized way of using them. You should be using different tables for storing types of data. If I have Users, Customers, and Receipts; I would create a separate table for each one of them. Then I would create two additional tables used for associations, one for Users->Receipts, and one for Customers->Receipts. These associative tables would only store the unique id's for the rows in the other tables.
Not sure if I explained clear enough or not, also not sure if it's quite the same idea as your system. Either way its best to have different table's for different types of data, since there's no sense in storing the same data multiple times.
Certainly use multiple tables, but not for each user. Say you have 10 users and each user has a separate table, if you want to see all the data from all the users you have to search through 10 tables, vs. just the main table for the type of data you want.
So instead of userA_orders, userB_orders, etc. you just have a single orders table, and store what user created the order in the record you insert into the table.
Posted 06 January 2013 - 16:15