1

I'm trying to dig into wp-cli and I can't find how to reset a config file I've created with the following command line (Note: I'm in the folder where I want the wordress to be installed):

$ wp core config --dbname=aaa --dbuser=bbb --dbpass=ccc --dbprefix=wp_ddd_
Success: Generated 'wp-config.php' file.

Apparently, file is created (even if I don't really understand where at the moement...). I've noticed that I had made a mistake in my parameters and when I wanted to relaunch the command, here is what I got:

$ wp core config --dbname=new_name --dbuser=bbb --dbpass=ccc --dbprefix=wp_ddd_
Error: The 'wp-config.php' file already exists.

How can I solve this and besides, Can someone explain me where this temporary config file is located?

Thanks ;)

1

How can I solve this and besides, Can someone explain me where this temporary config file is located?

This will be generated in the WordPress root folder, the same from where you call the wp-cli.

Keep in mind you need to provide the correct username password and database name, else it will error.

If you error like:

$ wp core config --dbname=new_name --dbuser=bbb --dbpass=ccc --dbprefix=wp_ddd_ Error: The 'wp-config.php' file already exists.

Then simple move that file like:

mv wp-config.php wp-config2.php

Hope this helps.

  • Hi @prosti and thanks for the reply. Unfortunately and that's why I'm confused about this, there's no wp-config.php file in the wordpress root folder !? So, I'm pretty sure there is a problem here because there is no file at all in the folder (even if the sudo wp core download command succeeded...) – MavBzh Jan 26 '17 at 13:08
  • OK, problem solved. It was a wp-cli installation problem I think. Thanks for your help! – MavBzh Jan 31 '17 at 11:50
  • I am glad it worked @MavBzh. – prosti Jan 31 '17 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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