Hi there,
I’m eager in starting to use Acf Composer, but I’m having problems getting Acorn to work in my theme…
Just running wp acorn from my sage10 theme already results in this error:
Warning: mysqli_real_connect(): (HY000/1045): Access denied for user 'user'@'localhost' (using password: YES) in /path/to/my/project/site/web/wp/wp-includes/wp-db.php on line 1653
Error: `Access denied for user 'user'@'localhost' (using password: YES)`
Error establishing a database connection
This either means that the username and password information in your `wp-config.php` file is incorrect or we can’t contact the database server at `localhost`. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure you have typed the correct hostname?
Are you sure the database server is running?
If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums. `Access denied for user 'wearee'@'localhost' (using password: YES)`
In my web folder I have added the correct credentials to the wp-cli.yml file and running wp @development from my theme folder gives no errors?
Clearly I’m missing something, but don’t know what?
Thanks for any pointers!
p.s. Im still on Composer 1.10.15, is 2.* required for Acorn?
I can’t answer that question w/ authority because I don’t know a great deal about them, but my guess is that because the wp acorn commands load (I believe) the whole Acorn thing when they start up, some part of that is potentially attempting to call the database outside of the context of the WP CLI command–wp acorn is basically shoehorning the Laravel console (or parts of it at least) into the WP CLI framework.
I don’t know exactly how WP CLI aliases work internally, but my guess is whatever they do is not strictly compatible w/ how Acorn does the above. I’ve never run into the problem you’re having because I’m too lazy to set up aliases (and to be perfectly honest; I don’t entirely trust them for reasons I can’t explain) so I run all my WP CLI stuff inside of my VM.
Were you previously running the wp acorn commands w/o the alias? Usually I try to run all wp commands “in” whatever environment my site actually exists in (i.e. if the site is in a VM, the commands should be run inside the VM). IME not doing that can lead to kind of odd errors (potentially including the one you described)–the wp commands are meant to interact with WordPress, and if they can’t access WordPress (distinct from being able to access the files that describe WordPress) then you’re using it outside of the intended context.