postgres-operator
postgres-operator copied to clipboard
Adding extension mysql_fdw to postgres-gis
I'm attempting to construct a Dockerfile using the postgres-gis-ubi8 base image. The extension I aim to install is mysql_fdw, a foreign data wrapper allowing PostgreSQL to interact with MySQL. To ensure successful installation, it's necessary to run the makefile. However, I consistently encounter an error with the makefile. I've included the Dockerfile below along with the link to the extension I intend to install. Any assistance would be greatly appreciated. Thanks in advance! Link of the extension:https://github.com/EnterpriseDB/mysql_fdw
FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.1-3.4-0
USER root
ARG myqld_fdw_release=2_9_1
ADD https://github.com/EnterpriseDB/mysql_fdw/archive/refs/tags/REL-${myqld_fdw_release}.tar.gz \
/tmp/mysql-fdw.tar.gz
RUN tar -xvf /tmp/mysql-fdw.tar.gz -C /tmp --one-top-level --strip-components 1 && \
rm -rf /tmp/mysql-fdw.tar.gz
WORKDIR /tmp/mysql-fdw
RUN export PATH=/usr/pgsql-16/bin/:$PATH
RUN make USE_PGXS=1
RUN make USE_PGXS=1 install
USER 26
Error I keep getting:
make: mysql_config: Command not found
make: mysql_config: Command not found
Makefile:44: *** PostgreSQL 11, 12, 13, 14, 15, or 16 is required to compile this extension. Stop.
hi @jahnavisana2812! This issue/error appears to be related the referenced extension, rather than anything with Crunchy Postgres for Kubernetes itself. E.g., nothing here indicates an issue with the Postgres container (e.g. the PATH
provided for Postgres is valid, etc.).
I therefore suggest trying your question with the maintainers of the extension, e.g. to get better insight into why these Make targets are failing, and what dependencies, setup, etc. is needed to make this work.
And in the meantime, I'll leave this issue open in case anyone else out there has any insight and/or ideas to help with your issue. Additionally, I'll note that you can try reaching out via the PGO project community discord as well.
Update:I have talked to their team and they have insisted to install mysql client library to compile mysql_fdw using sources.I was trying to install mysql client but keeps throwing error Unable to find package.Please suggest the right way to install.I was doing it the following way.
FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.1-3.4-0
USER root
ARG myqld_fdw_release=2_9_1
ADD https://github.com/EnterpriseDB/mysql_fdw/archive/refs/tags/REL-${myqld_fdw_release}.tar.gz \
/tmp/mysql-fdw.tar.gz
RUN microdnf install yum
RUN microdnf install dnf
RUN tar -xvf /tmp/mysql-fdw.tar.gz -C /tmp --one-top-level --strip-components 1 && \
rm -rf /tmp/mysql-fdw.tar.gz
RUN dnf install mysql-server
WORKDIR /tmp/mysql-fdw
RUN export PATH=/usr/pgsql-16/bin/:$PATH
RUN make USE_PGXS=1
RUN make USE_PGXS=1 install
USER 26
Error: Unable to find a match: mysql-server @andrewlecuyer can you suggest something on this I am unable to install it even using the rpm package