W3cubDocs

/WordPress

wpdb::db_version()

Retrieves the MySQL server version.

Return

(string|null) Version number on success, null on failure.

Source

File: wp-includes/wp-db.php

public function db_version() {
		return preg_replace( '/[^0-9.].*/', '', $this->db_server_info() );
	}

Changelog

Version Description
2.7.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wpdb/db_version