> For the complete documentation index, see [llms.txt](https://docs.vmgd.whatworks.com.au/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vmgd.whatworks.com.au/ict-team/setting-up-your-development-environment/configure-the-database-connection.md).

# Configure the database connection

In VSCode, open the public folder, e.g. \~/Local Sites/vmgd/app/public/wordpress

In the root folder, copy `wp-config-sample.php` to `wp-config.php`

In `wp-config.php` make the following changes:

* Set `DB_NAME` -> `local`
* Set `DB_USER` -> `root`
* Set `DB_PASSWORD` -> `root`

Copy and paste the following lines near the end of the file:

`define('WP_DEBUG', true);`\
`define('WP_DEBUG_LOG', true);`\
`define('WP_DEBUG_DISPLAY', false);`\
`define('FS_METHOD', 'direct');`\
`define('REPLACE_IMAGE_URL', 'https://content.vmgd.gov.vu');`

This will enable wordpress to write to the `wp-content/debug.log` file so you can view any wordpress errors/warnings. `FS_METHOD` setting allows you to install/update plugins.

The `REPLACE_IMAGE_URL` setting means that all images will be fetched from the live server so you don't have to download all the files to your local machine.

Now you go back to local program and hit open site. You will be redirected to:

{% embed url="<http://vmgd.local/wp-admin>" %}

If it says database update required hit update.

<figure><img src="https://2336033317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRZBPVHe4q0MJV3yhChBq%2Fuploads%2FEcMFSvlqkqlFKsEtyh4C%2Fimage.png?alt=media&amp;token=82103162-2fcd-4858-b74f-5ef957242dc4" alt=""><figcaption></figcaption></figure>

Login using the credentials you specified when creating the site, hopefully:&#x20;

**Username:** admin

**Password:** admin&#x20;

<figure><img src="https://2336033317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRZBPVHe4q0MJV3yhChBq%2Fuploads%2FtrPj1s77307JBCk09Wpw%2Fimage.png?alt=media&amp;token=c6b29266-4da8-4e86-b160-e7b4d1bffc0b" alt=""><figcaption></figcaption></figure>

You should see the dashboard:

<figure><img src="https://2336033317-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRZBPVHe4q0MJV3yhChBq%2Fuploads%2FUlhTkzK1BGyvxp2NLAo6%2Fimage.png?alt=media&amp;token=48468c9e-55fe-483e-b3ab-3be0882000e0" alt=""><figcaption></figcaption></figure>
