Canadian Posted November 24, 2009 Share Posted November 24, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/182803-mysql-users/ Share on other sites More sharing options...
Maq Posted November 24, 2009 Share Posted November 24, 2009 Hi Canadian, Reading through the MySQL manual should clear up some of your confusion: http://dev.mysql.com/doc/refman/5.1/en/user-account-management.html Quote Link to comment https://forums.phpfreaks.com/topic/182803-mysql-users/#findComment-964841 Share on other sites More sharing options...
Mchl Posted November 24, 2009 Share Posted November 24, 2009 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) Quote Link to comment https://forums.phpfreaks.com/topic/182803-mysql-users/#findComment-964845 Share on other sites More sharing options...
Canadian Posted November 24, 2009 Author Share Posted November 24, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/182803-mysql-users/#findComment-964850 Share on other sites More sharing options...
Mchl Posted November 24, 2009 Share Posted November 24, 2009 Yes you could, but that's usually done within application itself using ACLs (access control lists) Quote Link to comment https://forums.phpfreaks.com/topic/182803-mysql-users/#findComment-964858 Share on other sites More sharing options...
fenway Posted November 24, 2009 Share Posted November 24, 2009 Or with views. Quote Link to comment https://forums.phpfreaks.com/topic/182803-mysql-users/#findComment-964961 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.