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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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