Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

The short installation instruction for WordPress ("5 Minutes") state that:

Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it.

While setting up a new blog professionally I was wondering how that maps to what the MySQL database user privileges/permissions configuration offers me:

  • Data: SELECT, INSERT, UPDATE, DELETE
  • Definition: CREATE, ALTER, DROP
  • Extra: INDEX
  • More:
    1. LOCK TABLES
    2. REFERENCES
    3. CREATE TEMPORARY TABLES
    4. CREATE VIEW
    5. SHOW VIEW
    6. CREATE ROUTINE
    7. EXECUTE
    8. ALTER ROUTINE

I'm pretty sure for the first three groups, I named them Data, Definition and Extra here. But what about the others below the More entry? Normally I would say, those are not needed, but I would like to get a second opinion.

share|improve this question

2 Answers

up vote 2 down vote accepted

The others are not needed as you point out.

Btw, what you could do is, conditionally set the user/pass based on the requested page. As in unprivileged with select/insert/update/delete for normal usage, and privileged with definition/index related stuff in addition when visiting the upgrade page.

share|improve this answer

"All privileges" usually means you should grand everything to the user. However ...

I've found at least one article that claims the MySQL user only needs:

  • SELECT
  • INSERT
  • UPDATE

Digging deeper, I found that in order to operate fully (automated updates, plug-in installation/uninstallation, etc.), WordPress requires some additional permissions:

  • DELETE
  • ALTER (for updates)
  • CREATE TABLE
  • DROP TABLE

Also, not referenced but it makes sense:

  • INDEX

But those are the only two solid references I can find that are backed up by opinions posted elsewhere. I'd still encourage you to stick with GRANT ALL, but if you absolutely must limit your DB use, start with these 7 privileges and test fully to make sure things work as expected.

share|improve this answer
Thanks for sharing your thoughts. For that site installed I did not GRANT ALL as this is not a development site and instead stick to all incl. INDEX. Looks good so far, I think I keep it tracked over the next days, it's a real life site incl. a lot of plugin use and the like. For INDEX I might search core and the mysql manual a bit as well. – hakre Jan 6 '11 at 15:33
1  
Just remember that 3rd party plug-ins can call just about any SQL statement they want ... so make sure you properly vet them before installing things dependent on privileges you've revoked. – EAMann Jan 6 '11 at 15:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.