# DROP SERVER

## Syntax

```sql
DROP SERVER [ IF EXISTS ] server_name
```

## Description

Drops the server definition for the server named *server\_name*. The corresponding row within the [mysql.servers table](https://mariadb.com/docs/server/reference/system-tables/the-mysql-database-tables/mysql-servers-table) will be deleted. This statement requires the [SUPER](https://mariadb.com/docs/server/reference/account-management-sql-statements/grant#super) privilege or, from [MariaDB 10.5.2](https://app.gitbook.com/s/aEnK0ZXmUbJzqQrTjFyb/community-server/old-releases/10.5/10.5.2), the [FEDERATED ADMIN](https://mariadb.com/docs/server/reference/account-management-sql-statements/grant#federated-admin) privilege.

Dropping a server for a table does not affect any [FederatedX](https://mariadb.com/docs/server/server-usage/storage-engines/federatedx-storage-engine), [FEDERATED](https://mariadb.com/docs/server/server-usage/storage-engines/legacy-storage-engines/federated-storage-engine), [Connect](https://mariadb.com/docs/server/server-usage/storage-engines/connect) or [Spider](https://mariadb.com/docs/server/server-usage/storage-engines/spider) tables that used this connection information when they were created.

DROP SERVER is not written to the [binary log](https://mariadb.com/docs/server/server-management/server-monitoring-logs/binary-log), irrespective of the [binary log format](https://mariadb.com/docs/server/server-management/server-monitoring-logs/binary-log/binary-log-formats) being used. From [MariaDB 10.1.13](https://app.gitbook.com/s/aEnK0ZXmUbJzqQrTjFyb/community-server/old-releases/10.1/10.1.13), [Galera](https://app.gitbook.com/s/3VYeeVGUV4AMqrA3zwy7/galera-management/installation-and-deployment/getting-started-with-mariadb-galera-cluster) replicates the [CREATE SERVER](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-server), [ALTER SERVER](https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-server) and DROP SERVER statements.

#### IF EXISTS

If the IF EXISTS clause is used, MariaDB will not return an error if the server does not exist. Unlike all other statements, DROP SERVER IF EXISTS does not issue a note if the server does not exist. See [MDEV-9400](https://jira.mariadb.org/browse/MDEV-9400).

## Examples

```sql
DROP SERVER s;
```

IF EXISTS:

```sql
DROP SERVER s;
ERROR 1477 (HY000): The foreign server name you are trying to reference 
  does not exist. Data source error:  s

DROP SERVER IF EXISTS s;
Query OK, 0 rows affected (0.00 sec)
```

## See Also

* [CREATE SERVER](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-server)
* [ALTER SERVER](https://mariadb.com/docs/server/reference/sql-statements/data-definition/alter/alter-server)
* [Spider Storage Engine](https://mariadb.com/docs/server/server-usage/storage-engines/spider)
* [FederatedX Storage Engine](https://mariadb.com/docs/server/server-usage/storage-engines/federatedx-storage-engine)
* [Connect Storage Engine](https://mariadb.com/docs/server/server-usage/storage-engines/connect)
* [mysql.servers table](https://mariadb.com/docs/server/reference/system-tables/the-mysql-database-tables/mysql-servers-table)

<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" %}
