i am really confused should i need to create seprate mysql accounts for every user who register on my website or just create 1 mysql user to query database for all users somehow i am very confused
if i create 1 mysql user for all users on my site when the number of users would grow it could lead to problem because many user may be querying at the same time which will create multiple CRUD operations which will lead to many problems and can crash database.
i am really confused i some how dont feel its right to allow all my users on website to have mysql account of their own on database . i feel this could some how create a security threat or may be mysql has limit on number of users which can be created i really dont what i am thinking is right or not
should i create a single mysql user to let all my website users to query database to get their respective data and create a database n store all users information in one database n user relationships to connect each other website user
By creating multiple MySQL users, you can assign different privileges to keep your data safe.
You need to create an account to use for connecting to the MySQL server running on a given host.
The MySQL Create User statement allows us to create a new user account in the database server. It provides authentication, SSL/TLS, resource-limit, role, and password management properties for the new accounts. It also enables us to control the accounts that should be initially locked or unlocked.
MySQL creates a database for storing and manipulating data, defining the relationship of each table. Clients can make requests by typing specific SQL statements on MySQL. The server application will respond with the requested information and it will appear on the clients' side.
You only create MySQL accounts for things that directly access MySQL. Users of a website are not accessing MySQL. They're accessing a PHP script which accesses MySQL on their behalf.
The ONLY time you'd create per-user accounts is if you were turning your server into a general hosting platform, and each user would be running their own databases within MySQL.
To expand the answer from @Marc B:
I usually set up 3 user accounts for each XAMP project:
project-developer has full access to everything, including CREATE/GRANT. Can create tables and maintain the db.
project-webuser has SELECT access to most things, UPDATE/INSERT access only to those tables directly needed by general web users.
project-webadmin has UPDATE/INSERT access to tables needed to maintain project data. There is usually a separate Admin web page for owners/managers to maintain the web site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With