轩辕镜像 官方专业版
轩辕镜像
专业版
轩辕镜像 官方专业版
轩辕镜像
专业版
首页个人中心搜索镜像
交易
充值流量¥7起我的订单
文档
工具
提交工单页面收录
mysql-to-pgsql-proxy

sadiksajid/mysql-to-pgsql-proxy

sadiksajid

MySQL to PostgreSQL Sync Proxy

下载次数: 0状态:社区镜像维护者:sadiksajid仓库类型:镜像最近更新:5 个月前
让 AI 帮你使用轩辕镜像? · 展开查看说明 · 点击收起说明

如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。

只需在 AI 对话中先发送下面这句话即可:

请先完整阅读并严格遵守以下文档中的全部规则与要求:

https://xuanyuan.cloud/agents.md

在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。

查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。

镜像简介
下载命令
镜像标签列表与下载命令
轩辕镜像,不浪费每一次拉取。
点击查看

MySQL to PostgreSQL Sync Proxy A powerful, real-time database synchronization tool that migrates and continuously syncs data from MySQL to PostgreSQL. Built with Rust for high performance and reliability.

🚀 Features Core Synchronization Schema Migration: Automatic conversion of MySQL schemas to PostgreSQL-compatible structures Initial Data Transfer: Bulk transfer of existing data with configurable batch sizes Real-time Sync: Continuous monitoring and replication of INSERT, UPDATE, DELETE operations Catch-up Sync: Ensures no data is lost during initial migration by replaying changes Three Sync Modes: Choose between Full Sync, Initial Sync Only, or Real-time Sync Only Database Objects Migration Views: Migrates MySQL views to PostgreSQL Functions: Converts MySQL stored functions to PostgreSQL equivalents Procedures: Migrates stored procedures with parameter mapping Triggers: Converts MySQL triggers to PostgreSQL trigger functions AI-Powered Conversion: Optional *** AI integration for intelligent SQL conversion Web UI Modern Dashboard: Intuitive web interface for configuration and monitoring Live Statistics: Real-time operation tracking with hourly analytics Interactive Charts: Beautiful line graphs showing sync operations over time User Authentication: Secure login system with session management Persistent Configuration: All settings saved in SQLite database Monitoring & Analytics Operation Statistics: Track INSERT, UPDATE, DELETE counts by hour Success/Failure Tracking: Monitor operation success rates Live Logs: Real-time logging of all sync activities SQLite Storage: Persistent statistics with queryable data 📋 Requirements MySQL Database MySQL 5.7+ or MariaDB 10.2+ general_log must be enabled (tool enables it automatically if you have SUPER privilege) User with permissions: SELECT on source database SELECT on mysql.general_log SUPER privilege (for enabling general_log) PostgreSQL Database PostgreSQL 10+ User with permissions: CREATE tables and schemas INSERT, UPDATE, DELETE on target database System Requirements Docker (recommended) or Rust 1.70+ 512MB RAM minimum (1GB+ recommended) Network access between source MySQL and target PostgreSQL 🔧 Installation Using Docker (Recommended) Clone the repository git clone cd "mysql to psql proxy" Run the Web UI ./run-web-ui.sh The Web UI will be available at http://localhost:5009

Using Docker Compose docker-compose up -d From Source

Install Rust

curl --proto '=https' --tlsv1.2 -sSf [***] | sh

Build the project

cargo build --release

Run with web UI

./target/release/mysql_psql_proxy --web-ui ⚙️ Configuration Web UI Configuration Open http://localhost:5009 in your browser Create first user account (appears on first run) Go to Settings tab Fill in MySQL and PostgreSQL connection details: MySQL: Host, Port, Database, Username, Password PostgreSQL: Host, Port, Database, Username, Password Configure sync options: Batch Size: Records per batch (default: 100) Poll Interval: Seconds between change checks (default: 10) Sync Mode: Full Sync / Initial Only / Real-time Only (Optional) Add *** API key for intelligent SQL conversion Click Save Configuration Environment Variables (CLI Mode)

MySQL Configuration

export DB_HOST=localhost export DB_PORT=3306 export DB_DATABASE=mydb export DB_USERNAME=user export DB_PASSWORD=password

PostgreSQL Configuration

export PSQL_DB_HOST=localhost export PSQL_DB_PORT=5432 export PSQL_DB_DATABASE=mydb export PSQL_DB_USERNAME=user export PSQL_DB_PASSWORD=password

Sync Configuration

export BATCH_SIZE=100 export POLL_INTERVAL_SECS=10

Optional: *** AI for DB objects migration

export ***_API_KEY=your-api-key export _MODEL=-2.0-flash-exp 🎯 Usage Web UI Mode (Recommended) Start the application

./run-web-ui.sh Access the dashboard at http://localhost:5009

Configure connections in the Settings tab

Select sync mode in the Home tab:

Full Sync: Complete migration + continuous monitoring (recommended for first-time) Initial Sync Only: Schema + data transfer, then stops Real-time Sync Only: Only monitors changes (assumes data already migrated) Start synchronization by clicking "Start Sync"

Monitor progress:

Home: Current status and quick stats Logs: Detailed operation logs Statistics: Operation counts and performance metrics Chart: Hourly operation trends with interactive line graph CLI Mode Full Sync (Initial + Real-time) ./rebuild-and-run.sh --full-sync Initial Sync Only ./rebuild-and-run.sh --initial-sync Real-time Sync Only ./rebuild-and-run.sh --realtime-sync 🔄 Sync Modes Explained

  1. Full Sync (Recommended for First-Time) What it does:

Phase 1: Migrates schema and transfers all existing data Phase 2: Replays changes that occurred during initial transfer (catch-up) Phase 3: Starts real-time monitoring of new changes Best for:

First-time migration from MySQL to PostgreSQL Complete database replication Ensuring zero data loss 2. Initial Sync Only What it does:

Migrates schema to PostgreSQL Transfers all existing data Stops after completion Best for:

One-time data migration Testing schema conversion Creating a snapshot of current data 3. Real-time Sync Only What it does:

Assumes schema and data already exist in PostgreSQL Only monitors and replicates new changes Uses MySQL general_log for change detection Best for:

Resuming sync after interruption Monitoring ongoing changes after initial migration Continuous replication setups 🗃️ Database Objects Migration The tool can migrate complex database objects using two methods:

  1. Regex-Based Conversion (Default) Automatically converts basic SQL syntax:

Data type mapping (INT → INTEGER, VARCHAR → VARCHAR, etc.) Function syntax adjustments Trigger format conversion 2. AI-Powered Conversion (Optional) With *** API key configured:

Intelligent SQL translation Complex syntax handling Parameter and variable mapping Error-free PostgreSQL generation To enable AI conversion:

Get a free API key from Google AI Studio Add it in Settings → *** API Key AI will be used automatically for views, functions, procedures, and triggers Rate Limiting:

1 API call per minute to avoid quota issues Automatic fallback to regex conversion on quota exceeded 📊 Statistics & Monitoring Real-Time Statistics The tool tracks every operation and provides:

Hourly aggregation: Operations grouped by hour Operation breakdown: Separate counts for INSERT, UPDATE, DELETE Success rates: Track successful vs failed operations Persistent storage: All stats saved to SQLite database Interactive Chart Line graph showing operation trends over time Three colored lines: Green (INSERT), Blue (UPDATE), Red (DELETE) Smooth curves with filled areas for easy visualization Hover tooltips showing exact operation counts Last 24 hours of data displayed Accessing Statistics Web UI: Go to Chart tab for visual representation Database: Query operation_stats table in SQLite for custom analytics API: /api/chart-stats endpoint returns JSON data 🔐 Security Authentication First-time setup: Create initial admin user on first launch Password hashing: bcrypt with secure salt Session management: HTTP-only cookies with expiration Protected routes: All API endpoints require authentication User Management Profile updates: Change email and password anytime Session timeout: Automatic logout after inactivity Secure storage: User credentials stored in SQLite with encryption 🐳 Docker Deployment Using Docker Compose Create docker-compose.yml:

version: '3.8'

services: mysql-psql-sync: image: mysql_psql_proxy:latest ports: - "5009:5009" volumes: - ./mysql_psql_data:/app/data environment: - RUST_LOG=info command: --web-ui restart: unless-stopped Run:

docker-compose up -d Using Docker Run docker run -d
-p 5009:5009
-v $(pwd)/mysql_psql_data:/app/data
-e RUST_LOG=info
--name mysql_psql_ui
mysql_psql_proxy:latest --web-ui Volume Persistence The /app/data volume contains:

config.db: SQLite database with all settings User credentials and sessions Operation statistics Configuration history 🛠️ Troubleshooting General_log Errors Problem: general_log is not enabled Solution: The tool enables it automatically if you have SUPER privilege. If not:

SET GLOBAL general_log = 'ON'; SET GLOBAL log_output = 'TABLE'; First Operation Not Detected Problem: First change after starting sync is missed Solution: This is now fixed! The tool waits 2 seconds after initialization before declaring sync active.

Slow Performance Problem: High CPU or slow queries Solutions:

Increase POLL_INTERVAL_SECS (default: 10) Reduce BATCH_SIZE if memory is limited The tool automatically cleans old general_log entries Connection Errors Problem: Cannot connect to MySQL/PostgreSQL Solutions:

Verify credentials in Settings Check network connectivity Ensure databases are accessible from container Use Test Connection button in Web UI Chart Shows No Data Problem: Operations occur but chart is e***y Solution: The tool now saves statistics to SQLite. Make sure:

Real-time sync is running Operations are being made in MySQL Wait 2-4 seconds for first detection Check Logs tab for operation confirmations Database Object Migration Fails Problem: Views/functions not migrating correctly Solutions:

Add *** API key for AI-powered conversion Check logs for specific SQL errors Manually adjust complex objects after migration Some MySQL-specific features may need manual conversion 📚 API Endpoints Authentication POST /api/login - User login POST /api/logout - User logout GET /api/check-auth - Check authentication status POST /api/setup-first-user - Create first user Configuration GET /api/config - Get current configuration POST /api/config - Update configuration POST /api/test-connection - Test database connections Sync Control POST /api/sync/start - Start synchronization POST /api/sync/stop - Stop synchronization GET /api/status - Get sync status Monitoring GET /api/stats - Get sync statistics GET /api/logs - Get operation logs GET /api/chart-stats - Get hourly chart data User Management GET /api/profile - Get user profile POST /api/update-email - Update user email POST /api/update-password - Change password 🏗️ Architecture Technology Stack Backend: Rust (Tokio async runtime) Web Framework: Axum Database Drivers: sqlx (MySQL, PostgreSQL, SQLite) Frontend: Vanilla JavaScript, Chart.js Storage: SQLite for config and stats AI Integration: Google *** API Components Schema Reader: Analyzes MySQL schema structure Table Creator: Generates PostgreSQL-compatible DDL Data Migrator: Bulk transfers with batching ***log Reader: Monitors MySQL general_log for changes PG Writer: Applies operations to PostgreSQL Stats Logger: Tracks operations in SQLite Web Server: Axum HTTP server with authentication Routine Migrator: Converts database objects Data Flow MySQL → Schema Reader → Table Creator → PostgreSQL ↓ ↑ General Log → ***log Reader → Event Queue → PG Writer ↓ Stats Logger → SQLite → Chart API → Web UI 🤝 Contributing Contributions are welcome! Please:

Fork the repository Create a feature branch Make your changes Submit a pull request 📄 License [Your License Here]

🙋 Support For issues, questions, or feature requests:

Open an issue on GitHub Check logs at /api/logs for debugging Enable RUST_LOG=debug for detailed logging

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 mysql-to-pgsql-proxy 镜像标签

docker pull docker.xuanyuan.run/sadiksajid/mysql-to-pgsql-proxy:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull sadiksajid/mysql-to-pgsql-proxy:<标签>

轩辕镜像配置手册

按平台快速找到配置文档

一键安装

一键安装 Docker

Linux Docker 一键安装

AI

用 AI 使用轩辕镜像

agents.md · AI 对话 · 提示词

Docker

登录仓库拉取

登录认证 · 私有仓库

专属域名拉取

免登录 · 高速拉取

Linux

Docker 镜像配置

Windows / Mac

Docker Desktop 配置

MacOS OrbStack

OrbStack 容器

Apple Container

macOS 原生容器

Docker Compose

Compose 项目配置

NAS

群晖

Synology 配置

飞牛

fnOS 镜像配置

绿联

绿联 NAS

威联通

QNAP 配置

极空间

极空间 NAS

Unraid

Unraid NAS

企业仓库

其他仓库

ghcr · Quay · nvcr

Harbor 镜像源

Proxy Repository 对接

Portainer 镜像源

Registries 配置

Nexus 镜像源

Docker Proxy 缓存

开发工具

Dev Containers

VS Code 开发容器

Podman

Podman 配置指南

Singularity / Apptainer

HPC 科学计算容器

Kubernetes

K8s Containerd

Kubernetes · Containerd

K3s

轻量级集群

面板 / 网络

爱快路由

iKuai 镜像加速

宝塔面板

一键配置镜像源

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

功能

版本功能对比

功能对比 · 版本选择

支持的镜像仓库

Docker Hub · GCR · GHCR

新手拉取配置

登录 · 专属域名 · 配置

docker search 限制

专属域名 · Hub 搜索

不支持 push

仅支持 pull · 不支持

拉取速度原因

带宽 · 缓存 · 冷热镜像

错误码

402 与流量用尽

402 · 流量包 · 充值

401 认证失败

401 · docker login

manifest unknown

标签错误 · 镜像不存在

410 Gone 排查

410 · Docker 升级

429 限流

免费版 · 专业版 · 企业版 · 请求频率

其他报错

DNS 超时

DNS 解析 · 网络超时

TLS 证书失败

no matching manifest(架构)

账号

失败是否计费

manifest · blob · 计费

申请开发票(企业 / 个人)

企业 · 个人 · 工单

修改登录密码

网站 · 仓库 · 重置

注销账户

工单 · 数据 · 注销

原理

mirrors 不生效

daemon.json · 重启

去掉域名前缀

docker tag · 重命名

指定架构拉取

ARM64 · AMD64 · 多架构

latest 与「最新」

digest · 版本号 · 标签

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
sadiksajid/mysql-to-pgsql-proxy
教程轩辕镜像功能与使用教程
定价查看流量套餐与价格
热门查看热门 Docker 镜像推荐
博客Docker 镜像公告与技术博客
专业版 · 高速稳定拉取镜像
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
50GB 仅 ¥7/年
专业版 · 高速稳定拉取镜像
50GB 仅 ¥7/年
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
用户协议·隐私政策·增值电信业务经营许可证:浙B2-20261007·©2024-2026 源码跳动©2024-2026 杭州源码跳动科技有限公司·商务合作:点击复制邮箱

更多 mysql-to-pgsql-proxy 镜像推荐

haproxytech/haproxy-debian logo

haproxytech/haproxy-debian

haproxytech
HAProxy社区版Docker Debian镜像,提供高性能的开源负载均衡和应用交付控制功能,支持TCP/HTTP代理、SSL终止、健康检查等特性,适用于构建可靠的流量管理解决方案。
9 次收藏1000万+ 次下载
1 天前更新
haproxytech/haproxy-alpine logo

haproxytech/haproxy-alpine

haproxytech
HAProxy社区版Docker镜像,基于Alpine Linux构建,提供高性能负载均衡与反向代理功能,适用于构建轻量级、高可用的Web服务或应用集群。
19 次收藏500万+ 次下载
2 天前更新
mysql logo

library/mysql

Docker 官方镜像
MySQL 官方 Docker 镜像,提供开箱即用的关系型数据库服务,支持通过环境变量完成库和账号初始化,并结合数据卷实现持久化存储,适合本地开发、集成测试及小到中型生产环境的数据库部署。
1.6万 次收藏10亿+ 次下载
11 天前更新
zabbix/zabbix-proxy-mysql logo

zabbix/zabbix-proxy-mysql

zabbix
Zabbix proxy是开源监控解决方案Zabbix的分布式监控代理组件,其支持MySQL数据库作为后端存储,能够在分布式监控架构中承担数据收集、预处理与转发任务,有效减轻Zabbix server的负载压力,借助MySQL的稳定性能与可扩展性提升监控数据的存储效率和管理灵活性,适用于大规模网络环境下对多节点、多类型设备及服务的集中化监控需求。
48 次收藏1000万+ 次下载
5 小时前更新
haproxytech/haproxy-ubuntu logo

haproxytech/haproxy-ubuntu

haproxytech
HAProxy社区版Docker Ubuntu镜像
6 次收藏100万+ 次下载
2 天前更新
haproxytech/haproxy-qns logo

haproxytech/haproxy-qns

haproxytech
该Docker镜像包含用于HAProxy的QUIC互操作性测试文件
2 次收藏10万+ 次下载
2 天前更新

查看更多 mysql-to-pgsql-proxy 相关镜像