# SHOW MASTER STATUS

## Syntax

{% tabs %}
{% tab title="Current" %}

```sql
SHOW [MASTER | BINLOG] STATUS
```

{% endtab %}

{% tab title="< 10.5.2" %}

```sql
SHOW MASTER STATUS
```

{% endtab %}
{% endtabs %}

## Description

Provides status information about the [binary log](https://mariadb.com/docs/server/server-management/server-monitoring-logs/binary-log) files of the primary.

{% tabs %}
{% tab title="Current" %}
This statement requires the [BINLOG MONITOR](https://mariadb.com/docs/server/reference/account-management-sql-statements/grant#binlog-monitor) privilege.
{% endtab %}

{% tab title="< 10.5.2" %}
This statement requires the [SUPER](https://mariadb.com/docs/server/reference/account-management-sql-statements/grant#super) privilege and the [REPLICATION\_CLIENT](https://mariadb.com/docs/server/reference/account-management-sql-statements/grant#replication-client) privilege.
{% endtab %}
{% endtabs %}

{% hint style="info" %}
The following improved functionality is available from MariaDB 12.3.
{% endhint %}

To see information about the current [GTIDs](https://mariadb.com/docs/server/ha-and-performance/standard-replication/gtid) in the binary log, use the [gtid\_binlog\_pos](https://mariadb.com/docs/server/ha-and-performance/standard-replication/gtid) variable. It is enabled by default, and helps find the current state of the master server. (Previously, this required two statements, `SHOW MASTER STATUS` and `SELECT @@global.gtid_binlog_pos`.)

## Example

The following example works in all MariaDB versions. From MariaDB 12.3, the second statement doesn't have to be run, though, because `SHOW BINLOG STATUS` shows the value of `@@global.gtid_binlog_pos`, too.

```sql
SHOW BINLOG STATUS;
+--------------------+----------+--------------+------------------+
| File               | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+--------------------+----------+--------------+------------------+
| mariadb-bin.000016 |      475 |              |                  |
+--------------------+----------+--------------+------------------+
SELECT @@global.gtid_binlog_pos;
+--------------------------+
| @@global.gtid_binlog_pos |
+--------------------------+
| 0-1-2                    |
+--------------------------+
```

## See Also

* [MariaDB replication](https://mariadb.com/docs/server/ha-and-performance/standard-replication)
* [Using and Maintaining the Binary Log](https://mariadb.com/docs/server/server-management/server-monitoring-logs/binary-log/using-and-maintaining-the-binary-log)
* [The gtid\_binlog\_pos variable](https://mariadb.com/docs/server/ha-and-performance/standard-replication/gtid)

<sub>*This page is licensed: GPLv2, originally from*</sub> [<sub>*fill\_help\_tables.sql*</sub>](https://github.com/MariaDB/server/blob/main/scripts/fill_help_tables.sql)

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-binlog-status.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
