EnterpriseDB / mysql_fdw

PostgreSQL foreign data wrapper for MySQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to install the extension

jahnavisana2812 opened this issue · comments

Is there an alternative method to install the extension that doesn't involve using make? I attempted to use the EDB package, but encountered a "package not found" error. Could you assist me with this? Below are the steps I followed according to the provided repository.

  1. dnf install yum-utils
  2. rpm --import 'https://downloads.enterprisedb.com/XZ6NaT5ltHlE1Glt2x7byElgNDGKdY92/enterprise/gpg.E71EB0829F1EF813.key'
  3. curl -1sLf 'https://downloads.enterprisedb.com/XZ6NaT5ltHlE1Glt2x7byElgNDGKdY92/enterprise/config.rpm.txt?distro=el&codename=8' > /tmp/enterprise.repo
  4. dnf config-manager --add-repo '/tmp/enterprise.repo'
  5. dnf -q makecache -y --disablerepo='*' --enablerepo='enterprisedb-enterprise'
  6. sudo dnf -y install mysql_fdw_15

Error: Unable to find a match: mysql_fdw_15

HI Jahnavi,
I checked at my end against the steps mentioned by you and it seems working fine on RHEL8 x86_64.

[root@fde1228da0ab yum.repos.d]# sudo dnf -y install mysql_fdw_15 (working)

Uploading Screenshot 2024-04-15 at 6.01.49 PM.png…

Could you please just try like - ( connect to root and fire these commands one by one)

  1. curl -1sLf 'https://downloads.enterprisedb.com/XZ6NaT5ltHlE1Glt2x7byElgNDGKdY92/enterprise/setup.rpm.sh' | sudo -E bash
  2. sudo yum -qy module disable postgresql
  3. dnf -y install mysql_fdw_15

also could you please check if you can install this package
dnf install edb-as15-server

regards,

I am actually running these commands in a dockerfile.I tried the following 2 methods

  1. Using the makefile
  2. Using the edb repository file.
    Sharing the dockerfile of both the methods I tried
    Method 1:
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.

Method 2:

FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-16.1-3.4-0
USER root
RUN microdnf install -y dnf
RUN curl -1sLf 'https://downloads.enterprisedb.com/XZ6NaT5ltHlE1Glt2x7byElgNDGKdY92/enterprise/setup.rpm.sh' 
RUN dnf install edb-as15-server
RUN dnf -y install mysql_fdw_15

USER 26

Error I keep getting:

Error: Unable to find a match: edb-as15-server
Error: Unable to find a match: mysql_fdw_15

Hi @jahnavisana2812,

make: mysql_config: Command not found
make: mysql_config: Command not found

You need to install mysql client library to compile mysql_fdw using sources. Please install the required client library and let us know your feedback.

Can you help me out using EDB package?Instead of makefile

Hey,I have installed the mysql client and following is the attached dockerfile.I am still stuck at the same error.Please help!

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 -y yum
RUN rpm -Uvh https://repo.mysql.com/mysql80-community-release-el8-3.noarch.rpm
RUN sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo
RUN rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
RUN yum --enablerepo=mysql80-community install -y mysql-community-client
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 yum install -y gcc \
    mysql-server
RUN export PATH=/usr/pgsql-16/bin/:$PATH && export PATH=/usr/local/mysql/bin/:$PATH
RUN make USE_PGXS=1
RUN make USE_PGXS=1 install

USER 26

Error I'm 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.

You need to install mysql-devel package or whatever it is called.

Configured it successfully Now I don't get the error of the mysql_config not found but the Makefile:44 error still remains.Can someone help?Thanks in advance!

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 -y yum
RUN rpm -Uvh https://repo.mysql.com/mysql80-community-release-el8-3.noarch.rpm
RUN sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo
RUN rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
RUN yum --enablerepo=mysql80-community install -y mysql-community-client
RUN yum --enablerepo=mysql80-community install -y mysql-community-devel
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 yum install -y gcc \
    mysql-server
RUN export PATH=/usr/pgsql-16/bin/:$PATH && export PATH=/usr/local/mysql/bin/:$PATH
RUN make USE_PGXS=1
RUN make USE_PGXS=1 install

USER 26

Error:Makefile:44: *** PostgreSQL 11, 12, 13, 14, 15, or 16 is required to compile this extension. Stop.