下载mysql_fdw项目文件:https://pgxn.org/dist/mysql_fdw/

注:我使用的是ubuntu18.04,可以直接在仓库查看是否有二级制安装文件,当然是有的啦,这是很方便的一个方法

$ sudo apt search fdw
Sorting... Done
Full Text Search... Done
postgresql-10-mysql-fdw/bionic 2.3.0-2 amd64
Postgres 10 Foreign Data Wrapper for MySQL

 所以直接安装完事

$ sudo apt install postgresql-10-mysql-fdw

  

1.好了还是进入正题,首先进入项目目录

$ cd mysql_fdw/

2.源码目录下直接提供的Makefile文件,按理说直接make就可以进行编译,哈哈哈哈,不会那么简单的,编译依赖会让你对它烦的抓脚,所以看看READ.md吧.

其中说的很清楚:一 需要postgresql相关的依赖由pg_config提供; 二 需要mysql相关的依赖由mysql_config提供

This PostgreSQL extension implements a Foreign Data Wrapper (FDW) for
[MySQL][1]. Please note that this version of mysql_fdw works with PostgreSQL and EDB Postgres Advanced Server 9.5, 9.6, 10, 11, 12, and 13. 1. Installation
---------------
To compile the [MySQL][1] foreign data wrapper, MySQL's C client library is needed. This library can be downloaded from the official [MySQL website][1]. 1. To build on POSIX-compliant systems you need to ensure the `pg_config` executable is in your path when you run `make`. This executable is typically in your PostgreSQL installation's `bin` directory. For example: ```
$ export PATH=/usr/local/pgsql/bin/:$PATH
```
2. The `mysql_config` must also be in the path, it resides in the MySQL `bin` directory.
```
$ export PATH=/usr/local/mysql/bin/:$PATH
```
3. Compile the code using make.
```
$ make USE_PGXS=1
```
4. Finally install the foreign data wrapper.
```
$ make USE_PGXS=1 install
```
Not that we have tested the `mysql_fdw` extension only on MacOS and Ubuntu systems, but other \*NIX's should also work.

3.接下来开始编译

 make USE_PGXS=1

会出现下面的报错

make: mysql_config: Command not found
Makefile:58: ../../src/Makefile.global: No such file or directory
Makefile:59: /contrib/contrib-global.mk: No such file or directory

解决:make: mysql_config: Command not found ,安装 libmysqlclient-dev

sudo apt install libmysqlclient-dev 

解决

Makefile:58: ../../src/Makefile.global: No such file or directory
Makefile:59: /contrib/contrib-global.mk: No such file or directory 安装 postgresql-server-dev-all,postgresql-common
 
sudo apt-get install postgresql-server-dev-all
sudo apt-get install postgresql-common

4.然后便可以愉快的编译了

make USE_PGXS=1 

5.安装

make USE_PGXS=1 install

  

  

postgresql的mysql外部数据扩展mysql_fdw编译及安装的更多相关文章

  1. PostgreSQL 优势,MySQL 数据库自身的特性并不十分丰富,触发器和存储过程的支持较弱,Greenplum、AWS 的 Redshift 等都是基于 PostgreSQL 开发的

    PostgreSQL 优势 2016-10-20 21:36 686人阅读 评论(0) 收藏 举报  分类: MYSQL数据库(5)  PostgreSQL 是一个自由的对象-关系数据库服务器(数据库 ...

  2. Docker 安装mysql容器数据卷挂载到宿主机

    环境 Centos:7 Docker: 17.05-ce Mysql: 5.7 1. Mysql外部数据和配置文件路径 msyql配置文件路径:/etc/mysql mysql数据卷路径:/var/l ...

  3. PostgreSQL使用MySQL外表(mysql_fdw)

    postgres使用mysql外表 转载请注明出处https://www.cnblogs.com/funnyzpc/p/14223167.html 浅谈 postgres不知不觉已经升到了版本13,记 ...

  4. 试图使用未在此报表服务器中注册或此版 Reporting Services 不支持的数据扩展插件“Devart.Data.PostgreSql”

    数据源用的是Postgresql 我在Deploy Report的时候出现这条ErrorMessage Error 2 试图使用未在此报表服务器中注册或此版 Reporting Services 不支 ...

  5. MySQL 导入外部数据时报错:1153: Got a packet bigger than 'max_allowed_packet' 解决方案

    MySQL 导入外部数据时报错:1153: Got a packet bigger than 'max_allowed_packet' 解决方案 zoerywzhou@163.com http://w ...

  6. MySQL中地理位置数据扩展geometry的使用心得

    最近学习了些MySQL geometry数据存储和计算,在这里记录下. 1. 环境 geometry推荐在5.6版本以上使用,尽管大部分功能在5.5已经可用,除了距离计算函数st_distance等新 ...

  7. Flink 异步IO访问外部数据(mysql篇)

    接上篇:[翻译]Flink 异步I / O访问外部数据 最近看了大佬的博客,突然想起Async I/O方式是Blink 推给社区的一大重要功能,可以使用异步的方式获取外部数据,想着自己实现以下,项目上 ...

  8. MySQL 导入外部数据

    手工为数据库录入数据: 1 -- 使用数据库 2 use test; 3 4 -- 创建fruits数据表 5 create table fruits( 6 f_id char(10) not nul ...

  9. PostgreSQL与MySQL比较(转)

    Mysql 使用太广泛了,以至于我不得不将一些应用从mysql 迁移到postgresql, 很多开源软件都是以Mysql 作为数据库标准,并且以Mysql 作为抽象基础的,但是具体使用过程中,发现M ...

随机推荐

  1. JS 学习笔记 (七) 面向对象编程OOP

    1.前言 创建对象有很多种方法,最常见的是字面量创建和new Object()创建.但是在需要创建多个相同结构的对象时,这两种方法就不太方便了. 如:创建多个学生信息的对象 let tom = { n ...

  2. JavaScript for循环的终止问题

    js的for循环,return,break,continue的使用方式和解释 let funcFor = () => { for (let i = 0; i < 4; i++) { if ...

  3. K3S 安装及配置

    K3S安装 curl -sfL https://rancher-mirror.oss-cn-beijing.aliyuncs.com/k3s/k3s-install.sh | INSTALL_K3S_ ...

  4. 19、从键盘输入两个数字n,m,求解n,m的最小公倍数

    /* 从键盘输入两个数字n,m,求解n,m的最小公倍数 */ #include <stdio.h> #include <stdlib.h> void getLowsetComM ...

  5. vue 3.0 常用API 的介绍

    vue3.0 生命周期 写法一 和vue2.x 一致 区别在于(beforeUnmount.unmount)名称不一样 写法二 在setup 中使用, 需要引用 如: import { onBefor ...

  6. 重学c#系列——委托和匿名函数[二十五]

    前言 简单介绍一下什么是委托. 正文 以前也写过委托,这次算是重新归档,和新的补充吧. https://www.cnblogs.com/aoximin/p/13940125.html 有些人说委托是函 ...

  7. ArcEngine要素编辑遇到的一些问题

    1.如何开启编辑 IMap myMap = this._Aplication.ActiveView.FocusMap; IWorkspace myWorkspace = (myMap25Sheet.P ...

  8. 18V转5V,15V转5V的LDO和DC芯片方案

    18V 转 5V, 15V 转 5V 的 LDO:芯片的选择,特别是输入电压,在低电平 5V 以下的,基本上都是接近也可以.但是 5V 以上,如现在的 18V 和 15 的话,就不一样了.我们需要在选 ...

  9. Flaks框架(Flask请求响应,session,闪现,请求扩展,中间件,蓝图)

    目录 一:Flask请求响应 1.请求相关信息 2.flask新手四件套 3.响应相关信息(响应response增加数据返回) 二:session 1.session与cookie简介 2.在使用se ...

  10. md5-有道翻译

    网站 aHR0cHMlM0EvL2ZhbnlpLnlvdWRhby5jb20v 测试发现三个值是变化的 一.第一种方法 initiator一步一步找,在t.translate中找到以下内容 这里可以看 ...