<span class="resolved" aria-label="Resolved" title="Topic is resolved."></span>db: ‘unconnected’

[ad_1]

Replies: 1

Hello,

When using hyperdb, we got a lot of

Oct  5 13:57:59 vMariaDB01 mariadbd[1770838]: 2022-10-05 13:57:59 3683932 [Warning] Aborted connection 3683932 to db: 'unconnected' user: 'unauthenticated' host: 'x.x.x.x' (Got an error reading communication packets)
Oct  5 13:57:59 vMariaDB01 mariadbd[1770838]: 2022-10-05 13:57:59 3683932 [Warning] Aborted connection 3683932 to db: 'unconnected' user: 'unauthenticated' host: 'x.x.x.x' (This connection closed normally without authentication)
Oct  5 13:58:00 vMariaDB01 mariadbd[1770838]: 2022-10-05 13:58:00 3683936 [Warning] Aborted connection 3683936 to db: 'unconnected' user: 'unauthenticated' host: 'x.x.x.x' (Got an error reading communication packets)
Oct  5 13:58:00 vMariaDB01 mariadbd[1770838]: 2022-10-05 13:58:00 3683936 [Warning] Aborted connection 3683936 to db: 'unconnected' user: 'unauthenticated' host: 'x.x.x.x' (This connection closed normally without authentication)
Oct  5 13:58:12 vMariaDB01 mariadbd[1770838]: 2022-10-05 13:58:12 3683974 [Warning] Aborted connection 3683974 to db: 'unconnected' user: 'unauthenticated' host: 'x.x.x.x' (Got an error reading communication packets)
Oct  5 13:58:12 vMariaDB01 mariadbd[1770838]: 2022-10-05 13:58:12 3683974 [Warning] Aborted connection 3683974 to db: 'unconnected' user: 'unauthenticated' host: 'x.x.x.x' (This connection closed normally without authentication)
Oct  5 13:58:12 vMariaDB01 mariadbd[1770838]: 2022-10-05 13:58:12 3683977 [Warning] Aborted connection 3683977 to db: 'unconnected' user: 'unauthenticated' host: 'x.x.x.x' (Got an error reading communication packets)
Oct  5 13:58:12 vMariaDB01 mariadbd[1770838]: 2022-10-05 13:58:12 3683977 [Warning] Aborted connection 3683977 to db: 'unconnected' user: 'unauthenticated' host: 'x.x.x.x' (This connection closed normally without authentication)

Using this config:

<?php
/**
 * Register the primary server to HyperDB
 */

$wpdb->add_database( array(
        'host'     => DB_HOST,
        'user'     => DB_USER,
        'password' => DB_PASSWORD,
        'name'     => DB_NAME,
        'write'    => 1, // primary server takes write queries
        'read'     => 1, // ... and read queries
) );

/**
 * Register replica database server if it's available in this environment
 */

$wpdb->add_database(array(
        'host'     => DB_HOST . ':' . '3307',
        'user'     => DB_USER,
        'password' => DB_PASSWORD,
        'name'     => DB_NAME,
        'write'    => 0, // replica doesn't take write queries
        'read'     => 1, // ... but it does take read queries
));

// That's it!

Maybe our config is missing something…

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer