Add a MySQL Foreign Data Wrapper to Postgres

Nov. 1, 2023

Posted in:

CREATE SERVER mysql_server FOREIGN DATA WRAPPER mysql_fdw OPTIONS (host 'host.docker.internal', port '3306');
CREATE USER MAPPING FOR db SERVER mysql_server OPTIONS (username 'root', password 'hunter2');
IMPORT FOREIGN SCHEMA prod FROM SERVER mysql_server INTO public;

Tags

Return to blog