<p>The server name you are creating with CREATE SERVER already exists in mysql.servers, triggering error 1476.</p>
<p>MySQL Error 1476 ER_FOREIGN_SERVER_EXISTS signals that a foreign server with the given name already exists in mysql.servers. Drop or rename the existing server, or choose a different name to resolve the error.</p>
The foreign server, %s, you are trying to create already
MySQL raises error 1476 when a CREATE SERVER statement tries to register a foreign server name that is already present in the mysql.servers metadata table. MySQL blocks duplicate entries to keep server names unique.
The error stops the statement, leaving the new server definition unapplied. Fixing it is essential so that subsequent CREATE SERVER or CREATE TABLE statements depending on that server can succeed.
The error appears during initial setup of a FEDERATED table, during migrations that recreate servers, or in automated deployment scripts that run repeatedly without first checking existing metadata.
It can also surface after a failed DROP SERVER attempt where the metadata row remained, or when a team accidentally standardizes on the same server name in different environments.
The most common trigger is a previous CREATE SERVER with the same name that was not dropped.
Server names are case sensitive when the lower_case_table_names setting is 0, making NameX and namex different.
A crash or permission error may leave the mysql.servers row intact even after attempting DROP SERVER.
CI or migration tools that run idempotent scripts without an IF NOT EXISTS guard can recreate the statement each run.
Raised when a referenced server name is missing. Opposite of 1476.
Occurs when creating a table that already exists. Similar uniqueness constraint but on tables.
Triggered when attempting to create a database that already exists. Same prevention principle applies.
Run SELECT Server_name FROM mysql.servers to list all registered servers and locate the duplicate.
No. MySQL enforces unique server names to prevent ambiguity. Always use DROP SERVER or a new name.
Error 1476 exists in MySQL 5.1 and later. Behaviour is consistent across modern versions.
Galaxy's AI copilot autocompletes CREATE and DROP SERVER scripts with existence checks, reducing duplication in collaborative workflows.