Title: wp_check_mysql_version
Published: April 25, 2014
Last modified: February 24, 2026

---

# wp_check_mysql_version()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/wp_check_mysql_version/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_check_mysql_version/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_check_mysql_version/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_check_mysql_version/?output_format=md#wp--skip-link--target)

Checks the version of the installed MySQL binary.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_check_mysql_version/?output_format=md#source)󠁿

    ```php
    function wp_check_mysql_version() {
    	global $wpdb;
    	$result = $wpdb->check_database_version();
    	if ( is_wp_error( $result ) ) {
    		wp_die( $result );
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/upgrade.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/upgrade.php#L3652)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/upgrade.php#L3652-L3658)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_check_mysql_version/?output_format=md#related)󠁿

| Uses | Description | 
| [wpdb::check_database_version()](https://developer.wordpress.org/reference/classes/wpdb/check_database_version/)`wp-includes/class-wpdb.php` |

Determines whether the database server is at least the required minimum version.

  | 
| [wp_die()](https://developer.wordpress.org/reference/functions/wp_die/)`wp-includes/functions.php` |

Kills WordPress execution and displays HTML page with an error message.

  | 
| [is_wp_error()](https://developer.wordpress.org/reference/functions/is_wp_error/)`wp-includes/load.php` |

Checks whether the given variable is a WordPress Error.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/wp_check_mysql_version/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_check_mysql_version/?output_format=md#)

| Used by | Description | 
| [wp_upgrade()](https://developer.wordpress.org/reference/functions/wp_upgrade/)`wp-admin/includes/upgrade.php` |

Runs WordPress Upgrade functions.

  | 
| [wp_install()](https://developer.wordpress.org/reference/functions/wp_install/)`wp-admin/includes/upgrade.php` |

Installs the site.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_check_mysql_version/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_check_mysql_version%2F)
before being able to contribute a note or feedback.