Change database name

How can I change the database name? When changing the name with Adminer and in wp-config the site no longer seems to work

I might have found something, in the local adminer file on line 11 the name of the database is returned. I think I need to change that with the new database name too. Can anyone confirm?

Right now there’s no official way to change the database name. Since this is a local installation you can change the database name when you deploy.

I would advise against hacking around files because you can potentially create problems when importing/exporting or doing other tasks in Local.

Hmmm okay, so if I roll out 110 sites, then they will all share the local database? And on top of that they will all be automatically generated using the wp_ prefix. Isn’t that asking for conflicts?

If you’re talking about locally, each site is in its own completely isolated container running its own instance of MySQL 5.5 or 5.6 and nginx or Apache. There will be no conflicts :smiley:

Then, when you deploy you can just deploy to whatever database you have setup in production.

Ah allright, I misunderstood the setup side of it then.
Any chance to change the default database prefix?

I think that’ll be coming down the road in the form of an addon.

Depending on how you deploy that’s another thing that’s easily changed when deploying.

Yeah I’m aware it can be changed when deploying, it’s just that if I am to set up the ideal local dev, I might as well do it right from the get go. Using the default wp_ prefix is not doing it right for me, that’s all.
Anyways, thanks for your fast replies.

1 Like