Are there different user types in MySQL database?

Are there different user types in MySQL database?

Closed last year. Each user type will have different user interface and access different types of data. Their only similarity is they are using one web application but they access totally different things. Is it better to put them all in one user table like tbl_users or is it better to create tbl_admins, tbl_suppliers, tbl_employees?

Can a user table hold all three types of users?

Or, one more thing to consider: You might use a users table that holds only very limited information about users of all three types, and if the types have extended attributes that don’t relate well to one another, you can store those in other tables with a foreign key back to the main users table.

How to create three user tables in MySQL?

There is also a third choice: put the columns that all users have in common into tbl_users, and create three tables for tbl_admins, tbl_suppliers and tbl_employees joining to tbl_users as 1 to 0..1. You should consider this choice as an alternative when the number of shared columns is significant.

How are different user types similar to each other?

Update the question so it can be answered with facts and citations by editing this post . Closed last year. Each user type will have different user interface and access different types of data. Their only similarity is they are using one web application but they access totally different things.

Can you have more than one user in MySQL?

If you were ever to make a change to your login process, having 3 different tables would mean having to change the code in 3 separate places. If a user can belong to more than one role, consider making a UserRoles table.

Can a user belong to more than one role?

If a user can belong to more than one role, consider making a UserRoles table. Otherwise, adding an additional field to the existing table – such as RoleType – would help differentiate the different types of users.

How to show all users in MySQL database?

For example, SHOW DATABASES will show us all of the databases that are present in our MySQL Server, and SHOW TABLES will show us all the tables in the MySQL database that you have selected. It’s not unusual for people to assume that there should be a SHOW USERS command in MySQL.

What are the fields in mysql.user table?

The mysql.user table contains the following fields: Host (together with User makes up the unique identifier for this account. User (together with Host makes up the unique identifier for this account. Hashed password, generated by the PASSWORD () function.