多模式同时运行
The Halo database supports running multiple modes such as Oracle, MySQL, and PostgreSQL simultaneously within the same instance.
Modify the Configuration File
Edit $PGDATA/postgresql.conf and set cluster_net_services to multiple modes, separated by commas:
cluster_net_services = ':1521:oracle,:3306:mysql,:5432:postgresql'
# Specify the default database for MySQL mode
mysql.default_tenant = 'mysql'
Restart the Database
pg_ctl restart
Connection Test
Connect using the corresponding port and client for each mode:
# Oracle mode
hsql -d oracle -p 1521
# MySQL mode (if mysql.default_tenant is set)
mysql -h xxx.xxx.xxx.xxx -d xxx -u mysqltest -p
# MySQL mode (if mysql.default_tenant is empty)
mysql -h xxx.xxx.xxx.xxx -d xxx -u mysqltest@dbname -p
# PostgreSQL mode
psql -h xxx.xxx.xxx.xxx -d xxxx
Note:
- Each mode requires the corresponding extension to be created in its respective database (create
aux_oraclefor Oracle mode, andaux_mysqlfor MySQL mode).- Databases in both Oracle and MySQL modes must have their extensions created separately before compatible syntax can be used.