下载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. ubuntu+Django + nginx + uwsgi 部署

    ubuntu+Django + nginx + uwsgi 部署 0.前期准备 注意:以下几件事都必须在激活虚拟环境下完成 运行以下命令生成项目所需的依赖列表,会在项目根目录生成一个requireme ...

  2. JS 学习笔记 (六) 函数式编程

    1.函数闭包 1.1 概述 JavaScript采用词法作用域,函数的执行依赖于变量作用域,这个作用域是在函数定义时决定的,而不是函数调用时决定的. 为了实现这种词法作用域,JavaScript函数对 ...

  3. vue3中使用computed

    演示示例(vant组件库的轮播图): <van-swipe :loop="false" :width="150" class="my-Swipe ...

  4. Go语言核心36讲12

    作为Go语言最有特色的数据类型,通道(channel)完全可以与goroutine(也可称为go程)并驾齐驱,共同代表Go语言独有的并发编程模式和编程哲学. Don't communicate by ...

  5. phpword 模板文件导出word到服务器 并浏览器下载

    模板文件填充 然后生成新文件 //调用PHPwordrequire_once(ROOTPATH . "inc/vendor/autoload.php"); $phpWord = n ...

  6. MySQL57 zip安装

    引用:MySQL5.7的.zip文件的配置安装   由于MySQL5.7之后在javaEE中交互的端口发生了变化,而MySQL官网中5.6.5.7版本64位的只有.zip文件,而.zip文件不像直接下 ...

  7. python调用程序路径中包空格,及包含特殊字符问题

    解决办法 import os s = r'"C:\Program Files\Google\Chrome\Application\chrome.exe"' print(s) os. ...

  8. Docker的作用

    绝大部分应用,开发者都可以通过docker build创建镜像,通过docker push上传镜像,用户通过docker pull下载镜像,用docker run运行应用. 用户不需要再去关心如何搭建 ...

  9. django serializer.is_valid()总是返回False({'invalid': '无效数据。期待为字典类型,得到的是 {datatype} 。'})

    在调用添加接口时,一值失败,调试后发现传入的数据并没有问题,但是数据验证时一直返回False,此时使用  serializer.error_messages查看,所返回如下问题: 再往上看显示: 发现 ...

  10. html排版,样式

    <style>         .box{             width: 600px;             height: 800px;             backgro ...