Connect wordpress to aiven free mysql server

Hi, Can any one guide me. How can I connect my Wordpress web server to be connected to aiven free MySQL host.

2 Likes

Hey there, sure thing!

Once you download WordPress and start the installer, you’ll get to this step which asks for your database credentials:

To find those from the Aiven console, go to your Services list, and click on your MySQL database to get to its Overview page, which will look something like this:

You can use the little copy icons on the side to copy/pasta your Database Name, User, Password, and Host and Port from Aiven to WordPress, like so:

NOTE: Since the WordPress installer doesn’t have “Database Port” as a separate field, you need to “smoosh” hostname + port together with a “:” between, otherwise you’ll get an error about being unable to connect to the database.

You’ll know it works when it calls you “Sparky.” :sunglasses:

2 Likes

Alternately, if you already have a wp-config.php file, you can accomplish the same thing by editing the DB_ constants:

// ** Database settings - You can get this info from your web host ** //

/** The name of the database for WordPress */

define( 'DB_NAME', 'defaultdb' );

/** Database username */

define( 'DB_USER', 'avnadmin' );

/** Database password */

define( 'DB_PASSWORD', '<your password here>' );

/** Database hostname */

define( 'DB_HOST', '<your host name here>.aivencloud.com:24282' );
2 Likes

A post was split to a new topic: [ERROR 2002 (HY000): Can’t connect to MySQL server on ‘**********.aivencloud.com’ (115)]

i have the same problem but my code is in python can you give me the code in python

Hey @Shubham1, let’s deal with that issue over here: I can't connect my website with aiven mysql server (python)