MySQL: Using MySQL with WordPress
This documentation is part of the Getting started guide. View the full guide here: How to get started with MySQL.
👋 Welcome to the Stackhero documentation!
Stackhero provides a fully managed MySQL cloud service that simplifies deployment and management for production workloads:
- Unlimited connections and data transfers.
- Integrated phpMyAdmin web interface for easy database management.
- Hassle-free updates with one-click upgrades.
- Consistent performance and strong security on a private, dedicated infrastructure.
With Stackhero, you can have a reliable MySQL database ready in just a few minutes. Spend less time on setup and maintenance, and more time building your applications. Try MySQL cloud hosting on Stackhero today.
Connecting WordPress to Stackhero for MySQL is straightforward. You just need to edit your wp-config.php file like this:
define('DB_HOST', '<XXXXXX>.stackhero-network.com');
define('DB_PORT', '<PORT>');
define('DB_NAME', 'root');
define('DB_USER', 'root');
define('DB_PASSWORD', '<yourPassword>');
// Enable TLS encryption (also known as SSL)
define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);
The key step here is enabling TLS (SSL) encryption. Without this, your connection will not work as expected.