# How do you set or update the Database Name

**URL:** <https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808>\
**Category:** Support\
**Created:** [August 29, 2023, 7:44pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808 "2023-08-29T19:44:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkardell](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/dkardell/32/16030_2.png) [@dkardell](https://community.localwp.com/u/dkardell)\
**Post date:** [August 29, 2023, 7:44pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/1 "2023-08-29T19:44:29Z")

</div>

I know this was asked back in 2016; just wondering if there was an update. How do you set the database name for a site?

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [August 30, 2023, 3:17pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/2 "2023-08-30T15:17:54Z")

</div>

Hi @dkardell - The response to this would still be the same as the one below.

> [@Change database name](https://community.localwp.com/t/change-database-name/101/3):
>
> 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.

Is there a reason you need to do this locally? If so you could also create a feature request so that others can vote, comment, or follow. That way we can gauge interest in this for future releases.

---

<div class="post-metadata">

**Author:** ![dkardell](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/dkardell/32/16030_2.png) [@dkardell](https://community.localwp.com/u/dkardell)\
**Post date:** [August 30, 2023, 6:53pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/3 "2023-08-30T18:53:59Z")

</div>

I’m trying to develop multiple websites that all are installed on the same server.

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [August 30, 2023, 6:57pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/4 "2023-08-30T18:57:39Z")

</div>

Are you trying to create a multisite?

---

<div class="post-metadata">

**Author:** ![dkardell](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/dkardell/32/16030_2.png) [@dkardell](https://community.localwp.com/u/dkardell)\
**Post date:** [August 31, 2023, 2:22am UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/5 "2023-08-31T02:22:28Z")

</div>

No not multi-site. Independent domains on the same server each having their own named DB

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [August 31, 2023, 12:57pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/6 "2023-08-31T12:57:11Z")

</div>

Ah okay just making sure. Per the comment above you should be able to change the DB names when you deploy the sites to whatever server they’ll live on. Are you self hosting these?

---

<div class="post-metadata">

**Author:** ![dkardell](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/dkardell/32/16030_2.png) [@dkardell](https://community.localwp.com/u/dkardell)\
**Post date:** [August 31, 2023, 1:56pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/7 "2023-08-31T13:56:46Z")

</div>

Yes self hosting these. How would I update the export to use a different DB

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [August 31, 2023, 2:11pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/8 "2023-08-31T14:11:07Z")

</div>

This guide should help you to update the DBs once you move the sites.

> **[How to Change the WordPress Database Prefix to Improve Security](https://www.wpbeginner.com/wp-tutorials/how-to-change-the-wordpress-database-prefix-to-improve-security/)**
>
> Improve WordPress security by changing the WordPress Database Prefix. This article shows a step by step guide on changing the database prefix in WordPress.

---

<div class="post-metadata">

**Author:** ![dkardell](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/dkardell/32/16030_2.png) [@dkardell](https://community.localwp.com/u/dkardell)\
**Post date:** [August 31, 2023, 2:36pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/9 "2023-08-31T14:36:09Z")

</div>

Thanks… I was wondering if I could update that before importing it on the host. I guess I could always follow this after I deployed as long as I do not have a DB called “local” on my server. I’m just trying to make it cleaner on Export / Import.

---

<div class="post-metadata">

**Author:** ![dkardell](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/dkardell/32/16030_2.png) [@dkardell](https://community.localwp.com/u/dkardell)\
**Post date:** [August 31, 2023, 8:45pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/10 "2023-08-31T20:45:41Z")

</div>

I guess I don’t understand why we can’t just set it here:

 ![CleanShot 2023-08-31 at 15.44.06](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/0/4/043dcebd86e5bb825b8217cb7e403faa53abb412.png)

---

<div class="post-metadata">

**Author:** ![dkardell](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/dkardell/32/16030_2.png) [@dkardell](https://community.localwp.com/u/dkardell)\
**Post date:** [August 31, 2023, 8:52pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/11 "2023-08-31T20:52:23Z")

</div>

so can I just change {“database”:“local”,“user”:“root”,“password”:“root”} in the local-site.json and the config.php to be my database choice and username, password?

So wait… am I over thinking this… when you export form Local and then import, you on a server, you have to import with the DB already set up right? So do these import plugins ignore the DB, USERNAME and PW? I assume the answer is yes. What do these imports do with the wp-config.php?

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [September 5, 2023, 4:48pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/12 "2023-09-05T16:48:04Z")

</div>

Hi @dkardell

Thank you for your patience and communication! I’ll try to provide some more insight below here:

- As mentioned, Local doesn’t simply have a way to change the dbname, dbuser, and dbpass from the UI
- WordPress is written in a way that all the DB connection details are in the `wp-config.php` file. This is a file that is usually unique to the environment that each specific WP site (remote, staging, local) is running in. You probably shouldn’t upload this file to the server unless that’s really what you want to do.
- If you do need to make changes before uploading the site to the server, you can always unzip the archive, make the changes that need to be made before deploying, and then proceed with deploying in whatever way makes sense for the server.

When using our [Local Connect](https://localwp.com/help-docs/local-features/local-connect/) feature to push sites to WP Engine or Flywheel for example, all those deployment details are taken care of for you automatically. When deploying manually, those updates depend entirely on the remote server. Something that might be an option to help do this for you would be using a plugin alternative like [WP Migrate PRO](https://deliciousbrains.com/wp-migrate-db-pro/).

---

<div class="post-metadata">

**Author:** ![emmtre](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/emmtre/32/15116_2.png) [@emmtre](https://community.localwp.com/u/emmtre)\
**Post date:** [September 5, 2023, 4:58pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/13 "2023-09-05T16:58:10Z")

</div>

I would say the plugin [WP Migrate Pro](https://deliciousbrains.com/wp-migrate-db-pro/) is a must for this and it makes the process so much easier to migrate websites and changes to the database prefix and name on the fly.

> **[WP Migrate - Push/Pull Your WordPress Database & Files](https://deliciousbrains.com/wp-migrate-db-pro/)**
>
> Find out how WP Migrate can save you hours with 1-click migration for your database, media, themes & plugins. Watch a full demo to see how it works.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [December 4, 2023, 4:58pm UTC](https://community.localwp.com/t/how-do-you-set-or-update-the-database-name/38808/14 "2023-12-04T16:58:33Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
