> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/api-reference/endpoints/hosting/databases/setup-website-database.md).

# Setup website database

Creates a new MySQL database for the website and writes its connection details into the website's environment variables, then restarts the application.

{% openapi src="<https://developers.hostinger.com/openapi/openapi.json>" path="/api/hosting/v1/accounts/{username}/websites/{domain}/databases/setup" method="post" %}
<https://developers.hostinger.com/openapi/openapi.json>
{% endopenapi %}
