diff --git a/src/wp-includes/class-wpdb.php b/src/wp-includes/class-wpdb.php
index 39c467f031..baba39d91f 100644
--- a/src/wp-includes/class-wpdb.php
+++ b/src/wp-includes/class-wpdb.php
@@ -690,6 +690,21 @@ class wpdb {
 	 */
 	private $allow_unsafe_unquoted_parameters = true;
 
+	/**
+	 * Whether to use the mysqli extension over mysql. This is no longer used as the mysql
+	 * extension is no longer supported.
+	 *
+	 * Default true.
+	 *
+	 * @since 3.9.0
+	 * @since 6.4.0 This property was removed.
+	 * @since 6.4.1 This property was reinstated and its default value was changed to true.
+	 *              The property is no longer used in core but may be accessed externally.
+	 *
+	 * @var bool
+	 */
+	private $use_mysqli = true;
+
 	/**
 	 * Whether we've managed to successfully connect at some point.
 	 *
diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php
index 21c34cbadb..984fe6765c 100644
--- a/tests/phpunit/tests/db.php
+++ b/tests/phpunit/tests/db.php
@@ -2469,4 +2469,17 @@ class Tests_DB extends WP_UnitTestCase {
 			),
 		);
 	}
+
+	/**
+	 * This private property is no longer used but needs to be retained as it can be
+	 * accessed externally due to the `__get()` magic method.
+	 *
+	 * @ticket 59118
+	 * @ticket 59846
+	 */
+	public function test_use_mysqli_property_access() {
+		global $wpdb;
+
+		$this->assertTrue( $wpdb->use_mysqli );
+	}
 }