Jump to content

MySQL Users?


Canadian

Recommended Posts

I'm brand new to MySQL.  I reading through a section in a book and it's talking about users and granting them privileges.  I don't understand what a user is or why I would make one.  For example...

 

If I am the person designing the database for my website, why would I need other users?  Shouldn't I just be able to do everything as the admin user?  Maybe I'm missing something.  If someone could help clarify that would be greatly appreciated. 

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/182803-mysql-users/
Share on other sites

And to answer your question in very few words: you as a database administrator usually will work having all privileges to database, which means you can create and drop databases, tables and other objects, modify their structure etc.

However, your web application usually does just SELECT,UPDATE,INSERT,DELETE from tables. You can create a separate MySQL user, which will be used by your application to connect to database. This way you're protected from any SQL injection attacks, that might try DROP your database for example (this doesn't mean you shouldn't try to prevent such attacks within your application - it's just an easy way to make some of them impossible)

Link to comment
https://forums.phpfreaks.com/topic/182803-mysql-users/#findComment-964845
Share on other sites

Thanks Mchl.  That's exactly what I needed. 

 

I'm guessing that if I had employees who were working on the database, I could also set them up as users.  Depending on what I wanted those employees to do I could grant them certain privileges?

 

Again, thanks for clearing that up. 

Link to comment
https://forums.phpfreaks.com/topic/182803-mysql-users/#findComment-964850
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.