EnterpriseDB / mysql_fdw

PostgreSQL foreign data wrapper for MySQL
Other
530 stars 162 forks source link

Error and workaround. #140

Open TEH30P opened 7 years ago

TEH30P commented 7 years ago

[Centos 7] My installation process:

[root@? /]#yum install -y postgresql96-server
[root@? /]#yum install -y postgresql96-contrib
[root@? /]#yum install -y postgresql96-devel
[root@? /]#yum install -y mysql-client #MariaDB-client-10.2.6-1.el7.centos.x86_64
[root@? /]#yum install -y mysql-devel #MariaDB-devel-10.2.6-1.el7.centos.x86_64

After that, i downloaded MYSQL_FDW source from here and install it.

[root@? /]#cd /home/dba/mysql_fdw-master/ #source path
[root@? mysql_fdw-master]#export PATH=/usr/pgsql-9.6/bin/:/usr/lib64/mysql:$PATH make USE_PGXS=1
[root@? mysql_fdw-master]#make install
/usr/bin/mkdir -p '/usr/pgsql-9.6/lib'
/usr/bin/mkdir -p '/usr/pgsql-9.6/share/extension'
/usr/bin/mkdir -p '/usr/pgsql-9.6/share/extension'
/usr/bin/install -c -m 755  mysql_fdw.so '/usr/pgsql-9.6/lib/mysql_fdw.so'
/usr/bin/install -c -m 644 .//mysql_fdw.control '/usr/pgsql-9.6/share/extension/
/usr/bin/install -c -m 644 .//mysql_fdw--1.0.sql  '/usr/pgsql-9.6/share/extensio

When i tried to create mysql_fdw extension, i got error.

[root@? mysql_fdw-master]#psql -U postgres
psql (9.6.3)
Type "help" for help.

postgres=# CREATE EXTENSION mysql_fdw;
ERROR:  failed to load the mysql query:
libmysqlclient.so: cannot open shared object file: No such file or directory
HINT:  export LD_LIBRARY_PATH to locate the library

My workaround:

[root@? /]#export LD_LIBRARY_PATH=/usr/lib64 # Possibly no need.
[root@? /]# link /usr/lib64/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so
[root@? /]# link /usr/lib64/libmysqlclient.so.18 /usr/lib64/libmysqlclient_r.so
skplunkerin commented 6 years ago

After I installed the following, CREATE EXTENSION mysql_fdw; worked for me:

sudo apt-get install libmysqlclient-dev

(I also sudo apt-get install mysql-server before libmysqlclient-dev which didn't work... I'm not sure if that is also needed?)

rcaso commented 4 years ago

For Centos/RedHat you need install mariadb-libs