Skip to main content
Background Image
  1. PostgreSQL Posts/

OpenHalo: MySQL Wire-Compatible PostgreSQL is Here!

·713 words·4 mins· ·
Ruohang Feng
Author
Ruohang Feng
Pigsty Founder, @Vonng
Table of Contents

What? PostgreSQL can now be accessed using MySQL clients? That’s right, openHalo, which was open-sourced on April Fool’s Day, provides exactly this capability — allowing users to simultaneously access and manage the same database using both MySQL and PostgreSQL clients for read and write operations, based on PG 14.10 providing MySQL 5.7 compatibility.

The day before yesterday, openHalo open-sourced their MySQL-compatible PG kernel. Today I’ve built RPM packages and integrated them into Pigsty. The deployment is quite smooth, and after modifying a few lines of code, it integrates seamlessly with high availability, monitoring, and backup components.

openhalo.png

On the DB-Engine database popularity rankings, five databases lead by a significant margin, far ahead of other competitors: Oracle, SQL Server, MySQL, PostgreSQL, and MongoDB.

db-engine.png

And now PostgreSQL can be compatible with the other four databases:

By the way, all of the above kernel capabilities are now available out-of-the-box in Pigsty.


So, I Want to Try It, How Do I Set It Up?
#

Currently, Pigsty provides support for OpenHalo on EL systems. You can install it with the following commands:

Use Pigsty’s standard installation process and use the mysql configuration template.

curl -fsSL https://repo.pigsty.cc/get | bash; cd ~/pigsty
./bootstrap              # Prepare Pigsty dependencies
./configure -c mysql     # Use MySQL (openHalo) configuration template
./install.yml            # Install, for production deployment please modify passwords in pigsty.yml first

For production deployment, please be sure to modify the password parameters in the pigsty.yml configuration file before executing the installation playbook.

OpenHalo’s configuration is almost identical to PostgreSQL’s configuration. You can use the psql command-line tool to connect to the postgres database, and use the mysql command-line tool to connect to the mysql database.

all:
  children:
    pg-orio:
      vars:
        pg_databases:
        - {name: postgres ,extensions: [aux_mysql]}
  vars:
    pg_mode: mysql                    # MySQL Compatible Mode by HaloDB
    pg_version: 14                    # The current HaloDB is compatible with PG Major Version 14
    pg_packages: [ openhalodb, pgsql-common, mysql ]   # also install mysql client shell
    repo_modules: node,pgsql,infra,mysql
    repo_extra_packages: [ openhalodb, mysql ] # replace default postgresql kernel with openhalo packages

MySQL uses port 3306 by default. When accessing MySQL, the actual connection uses the postgres database. Please note that the “database” concept in MySQL actually corresponds to the “Schema” concept in PostgreSQL. Therefore, use mysql actually uses the mysql Schema in the postgres database.

The usernames and passwords used by MySQL are consistent with those in PostgreSQL. You can manage users and permissions using PostgreSQL’s standard methods.

Currently, OpenHalo officially ensures that Navicat can properly access this MySQL port, but Intellij IDEA’s DataGrip will report errors when accessing it.

mysql -h 127.0.0.1 -u dbuser_dba

The OpenHalo kernel installed by Pigsty is lightly modified based on the HaloTech-Co-Ltd/openHalo kernel:

  • Default database name changed from halo0root back to postgres
  • Removed the 1.0. prefix from the default version number, changed back to 14.10
  • Modified default configuration file to enable MySQL compatibility by default and listen on port 3306

Please note that Pigsty does not assume any warranty responsibility for using the OpenHalo kernel. For any issues and requirements encountered when using this kernel, please contact the original manufacturer for resolution.


There Are Other Kernel Tricks Too
#

Of course, Pigsty supports more than just OrioleDB as a PG branch kernel. You can also use:

  • Microsoft SQL Server compatible Babelfish (by AWS)
  • Oracle compatible IvorySQL (by HighGo)
  • Ultimate OLTP performance OrioleDB (by Supabase)
  • Aurora RAC flavored PolarDB (by Alibaba Cloud)
  • Proper domestic innovation-qualified, Oracle-compatible PolarDB O 2.0.
  • You can also use FerretDB + Microsoft’s DocumentDB to simulate PG as a MongoDB.
  • Use Pigsty’s self-built template to set up local Supabase with one click (OrioleDB’s daddy!).

Additionally, my friend Yurii, founder of Omnigres, is working on adding ETCD protocol support to PostgreSQL. In the not-too-distant future, you’ll probably be able to use PG as a better-performing/more reliable etcd for Kubernetes / Patroni.

kernels.png

Most importantly, all these capabilities are open source and already available out-of-the-box for free in Pigsty. So if you want to experience OpenHaloDB, why not find a server to try it out? One-click installation, ready in 10 minutes. See if it’s really as awesome as they claim.

Related

PGFS: Using Database as a Filesystem
·1540 words·8 mins
Leverage JuiceFS to turn PostgreSQL into a filesystem with PITR capabilities!
Database Planet Collision: When PG Falls for DuckDB
·1514 words·8 mins
If you ask me, we’re on the brink of a cosmic collision in database-land, and Postgres + DuckDB is the meteor we should all be watching.
PostgreSQL Ecosystem Frontier Developments
·1853 words·9 mins
Sharing some interesting recent developments in the PG ecosystem.
Database as Business Architecture
·1838 words·9 mins
Databases are the core of business architecture, but what happens if we go further and let databases become the business architecture itself?
Pig, The Postgres Extension Wizard
·541 words·3 mins
Why would we need yet another package manager for PostgreSQL & extensions?
7 Databases in 7 Weeks (2025)
·2114 words·10 mins
Is PostgreSQL the king of boring databases? Which databases show promise and punch in 2025?