# Anyone using Valet+ with wp-cli valet?

**URL:** https://discourse.roots.io/t/anyone-using-valet-with-wp-cli-valet/13600
**Category:** archived 🗄
**Created:** 2018-09-13T16:30:31Z
**Posts:** 3

## Post 1 by @mZoo — 2018-09-13T16:30:31Z

I recently got turned on to [Valet+](https://github.com/weprovide/valet-plus) from a [DeliciousBrains blog article](https://deliciousbrains.com/wordcamps-for-developers).

I’m just getting started and found my way into Ben Word’s article about [using Valet with Bedrock](https://roots.io/guides/wordpress-local-development-on-os-x-with-valet-and-bedrock).

It includes a reference to a wp-cli add-on that looks really useful: [WP-CLI Valet Command | Evan Mattson](https://aaemnnost.tv/wp-cli-commands/valet).

However it doesn’t seem to play well with valet+. I’m getting the following errors:

```
$ wp valet new demo

Don't go anywhere, this should only take a second...

**Error:** ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
```

And using the `--project` flag with bedrock:

```
$ wp valet new my-project --project=bedrock
Don't go anywhere, this should only take a second...
Error: 
                                                                          
  [Seld\JsonLint\ParsingException]                                        
  "./composer.json" does not contain valid JSON                           
  Parse error on line 1:                                                  
                                                                          
  ^                                                                       
  Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
```

Input, as always, hoped for…

---

## Post 2 by @mZoo — 2018-09-15T17:51:38Z

As per the wp-cli valet README, the “Access Denied” error is because wp-cli needed a password to connect to the local (brewed) mysql.

I didn’t have one set as was able to login to mysql as root without one:

```
mysql -uroot
#
```

So I set one: `$(brew --prefix mysql)/bin/mysqladmin -u root password apassword`

Now I can spin up WP sites like:

```
wp valet new site --dbpass=apassword
Don't go anywhere, this should only take a second...
Success: site ready! https://site.test
```

Loading over https, too!

I even added the password to `~/.wp-cli/config.yml` and now don’t need to add the flag.

Now I have updated the configuration and `project: bedrock` is working, too.

---

## Post 3 by @mZoo — 2018-10-09T19:35:08Z

On one computer the `~/.wp-cli/config.yml`was automatically populated, I guess by `wp valet`. In case not here’s default:

```
valet new:
 ## Uncomment or update the relevant lines when necessary to set your own defaults.
 project: bedrock # wp # or bedrock
 # in: # override - defaults to current directory
 version: latest
 # locale: # use if not English
 db: mysql # or sqlite
 # dbname: # defaults to wp_name
 dbuser: root # or any other local user capable of creating databases (MySQL only)
 dbpass: your_password # enter the appropriate password if necessary (MySQL only)
 dbprefix: wp_
 admin_user: admin
 admin_password: admin
 ## Boolean options can also be configured, too.
 # unsecure: false # set to true to override
 # portable: false # set to true to override
```

---

## Post 4 by @ben — 2022-02-26T03:19:35Z


