Skip to content
WP Cloud
WP Cloud
    • For Hosts
    • For Agencies
    • For Registrars
    • For Native Hosting
    • Performance
    • Security
    • Real-Time Automated Failover
    • Vertical Scaling and Bursting
    • WordPress Management
    • PanelAlpha Integration: White-Label WordPress Control Panel for Hosts
    • EasyEngine Panel Integration: Visual WordPress Management for WP Cloud
    • FAQs
    • WP Cloud API
    • Partner Portal
    • Documentation
    • New Partner Guide
    • Pressable
    • Convesio
    • Porkbun
    • PanelAlpha
    • Ivapix
    • UNC Greensboro
    • Impressive Hosting
    • Blog
    • Performance Benchmarks
  • Connect With Us
  • Login ↗
Start Here ↗
  • Solutions

    • For Hosts
    • For Agencies
    • For Registrars
    • For Native Hosting
    • Featured Partners

    Features

    • Performance
    • Security
    • Real-Time Automated Failover
    • Vertical Scaling and Bursting
    • WordPress Management

    Integrations

    • PanelAlpha Integration
    • Easy Engine Panel Integration

    Resources

    • FAQs
    • WP Cloud API
    • Partner Portal
    • Documentation
    • New Partner Guide
  • Case Studies
    • PressableA case study about how WP Cloud supports Pressable to power millions of page views daily.
    • Convesio
    • Porkbun
    • PanelAlpha
    • Ivapix
    • UNC Greensboro
    • Newspack
    • Inverse Paradox
  • Insights
    • Podcast
    • BlogWP Cloud blog page with latest news and updates about the platform.
    • Performance Benchmarks
  • Connect With Us
  • Login ↗
Start Here ↗

Browse

    • WP Cloud platform overview
    • Onboard and launch with WP Cloud
    • WP Cloud Partner Portal
    • Get support from WP Cloud
    • WP Cloud glossary
    • Manage and secure API keys
    • Client SSH
    • WP Cloud API quick start
    • Webhooks
    • Run bulk tasks across sites
      • Manage site domains and aliases
      • Domain verification records
      • TLS certificates
      • Manage custom TLS certificates
      • Cloudflare and WP Cloud
    • Clone a site
    • Configure resources, site type, and billing with site meta
    • Delete a site
    • Persistent data
    • Staging sites
    • Migrate a site to WP Cloud
      • SSH and SFTP access models
      • Client SSH
      • User SSH and SFTP access
      • Database credentials
      • phpMyAdmin
      • ABSPATH
      • Default wp-config.php
      • Site constants
      • Configure redirects and headers with custom-redirects.php
      • Akismet and Jetpack
      • Blocked and unsupported plugins
      • PHP lifecycle and supported versions
      • Symlinks and managed software
      • WordPress versions
      • Install Composer and WP-CLI packages
      • Manage platform software with WP-CLI
      • Useful WP-CLI commands
    • Transactional email
    • WordPress multisite
    • Cron scheduling
    • Decoupled and headless WordPress
    • Repair Yoast indexables
      • Page Cache
      • Edge Cache
      • Object Cache
      • Image transformation
      • Offload image sub-sizes
    • Configure lightweight 404s for static files
      • DDoS protection
      • Defensive Mode
      • Rate limiting
      • Network and web application firewalls
      • Bot protection
      • Password protection
      • HTTP and security headers
      • PHP filesystem access permissions
      • Scan a site for malware
    • Backups overview
    • Create an on-demand backup
    • Restore a backup
    • Jetpack backups
      • Error logs
      • Web server logs
    • Metrics
    • Application performance monitoring
    • Automated failover
    • IP ranges
    • Origin and edge servers
    • Server specifications and settings
    • EasyEngine integration
    • PanelAlpha integration
      • White labelling and co-marketing WP Cloud
      • WP Cloud logos
      • Terms of Service & Compliance
      • Prohibited content
      • Copyright infringement and takedown notifications
    • WP Cloud billing
    • WP Cloud for agencies and site networks
    • WP Cloud partner support options
    • Troubleshoot Page and Edge Cache
    • Troubleshoot HTTP 429 and 599 errors
    • WP Cloud HTTP status codes
    • Troubleshoot site performance
    • Cache slow database queries
    • Troubleshoot duplicate core files, wp-config.php, and wp-admin 403 errors
    • Troubleshoot email delivery
    • Troubleshoot PDF thumbnail generation
    • Troubleshoot TLS certificate provisioning
Documentation/Site access/Database access/Database credentials

Database credentials

LAST UPDATED

3 months ago

    WP Cloud supplies each site’s database connection values automatically. WordPress code should use the standard DB_HOST, DB_NAME, DB_USER, and DB_PASSWORD constants instead of storing another copy of the credentials.

    Do not replace the managed database configuration in wp-config.php. The file intentionally explains that WP Cloud provides these values from the site environment.

    /**
     * Database connection information is automatically provided.
     * There is no need to set or change the following database configuration
     * values:
     *   DB_HOST
     *   DB_NAME
     *   DB_USER
     *   DB_PASSWORD
     *   DB_CHARSET
     *   DB_COLLATE
     */Code language: JSON / JSON with Comments (json)

    Use credentials inside the site

    WordPress and code loaded through WordPress can use the standard database constants. A separate application running inside the same WP Cloud site environment can also use those constants after it loads WordPress.

    Do not create a public PHP file that prints the constants. Such a file exposes the database password to anyone who can request it and may remain accessible through caches, logs, or forgotten copies.

    For interactive database work, use phpMyAdmin or the database commands included with WP-CLI over SSH access. These methods avoid putting a credential in the web root.

    Reset the database password

    Use the reset-db-password/{type}/{site} operation when the current password was exposed or an unsupported manual change broke the site’s database connection.

    Before resetting or recreating a database, inspect any custom DB_CHARSET and DB_COLLATE definitions. Remove an unnecessary override or correct it to a supported value. An invalid collation can make database creation fail, for example:

    ERROR 1273 (HY000) at line 1: Unknown collation: 'ut8mb4_general_ci'Code language: JavaScript (javascript)

    Preserve the complete creation error. A failed reset can leave the site without a usable database, which also causes later database backups and data-sync work to fail. Correct the configuration and confirm that the database exists before retrying those operations.

    The reset request returns a job ID. Check the job until it succeeds before testing the site. WP Cloud then updates the managed site environment with the replacement password.

    A successful job means the platform changed its managed credential. It does not update a password copied into partner-owned software.

    Resetting the password can interrupt custom software that copied the old value instead of using the managed WordPress constants. Update any authorized integration that stores the password, then remove the old value from its configuration and logs.

    Direct database connections

    WP Cloud does not accept inbound database connections directly from external systems. Code running inside the site’s WP Cloud environment can connect with the managed constants.

    An application that supports a database connection through SSH may connect through the site’s SSH service. Use a site-scoped credential where possible and do not expose the database port publicly.

    Verify the connection

    After a reset or integration change:

    1. Wait for the password-reset job to report success.
    2. Load the site and a WordPress administration page that performs a database query.
    3. Run the integration’s safe connection check without printing the password.
    4. Confirm that the former password no longer works anywhere it was stored.
    Previous User SSH and SFTP access
    Next phpMyAdmin

    Related Guides

    • phpMyAdmin

      Generate a time-limited phpMyAdmin login URL and work safely with a WP Cloud site database.

      2 Min.

      READ

    On this page

      Contact support

      Contact us with Support issues and questions related to WP Cloud, the WP Cloud Atomic API, API-key IP allow list changes, Station, and more.

      Check the FAQs

      Have questions? Please visit our FAQ to learn more.

      An Automattic venture

      Work With Us

      Press

      Privacy Policy

      © 2021-2026 Automattic Inc.

      Notifications