wesleytodd / YeoPress

A Yeoman generator for WordPress
Other
1.08k stars 161 forks source link

Am I reading the documentation wrong? #177

Closed titantwentyone closed 8 years ago

titantwentyone commented 8 years ago

Just wanted to check more than anything. In the documentation, it states: "Other things I do: ... Create your database, all you have to do is make me a user". I am reading this as "I create a MySQL user and password and then you connect to the DB and create the database". Is that right? When I run

yo wordpress

giving the username and password it states

Cannot access database

Or have I totally misread that and I actually need to dome some work!

Great tool by the way - will be using this no matter the outcome.

edheltzel commented 8 years ago

does the user you created have root privileges ?

titantwentyone commented 8 years ago

Ah! Thank you! Totally missed that. (It was late when I posted!)

I use a policy of one user per database for WP installs. What would be nice would be if:

  1. We create a "yeopress@localhost" user with GRANT and CREATE privileges only (to be used every time we use YeoPress)
  2. yeopress creates a new database
  3. yeopress creates a new user
  4. yeopress assigns "Data" and "Structure" privileges to the new user for the new database
  5. The new user details are used in wp-config.php
edheltzel commented 8 years ago

Glad that helped.

wesleytodd commented 8 years ago

Thanks for the help @ginfuru!

Another simple solution for development is to create one user for all your local projects. The only reason you create multiple users in prod environments is to make sure a hacker or malicious user cant access other site's data. On your dev machine there is no benefit to having multiple users.

So since you shouldnt be using the same config in development as production anyway, you can just override the variables in prod using the local-config.php.