mysql-catalog-en
By creating a MySQL Catalog, you can directly query data in a MySQL database within VeloDB Cloud, enabling federated queries across data sources.
Prerequisites
- A MySQL database instance is running.
- A database user with query permissions is ready.
- VeloDB Cloud can access the MySQL instance via the network.
AWS RDS/Aurora Configuration (Optional)
If you are using Amazon RDS for MySQL or Amazon Aurora MySQL, you need to complete the following preparations:
-
Get the database endpoint and port.
-
Log in to the AWS RDS Console.
-
Select Databases in the left navigation bar.
-
Click on your database instance name.
-
In the Connectivity & security tab, find:
- Endpoint: Database connection address (e.g.,
mydb.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com). - Port: Database port (default is 3306 for MySQL).
Aurora Cluster Tip: If using Aurora, it is recommended to use the Reader endpoint (read-only queries) or Cluster endpoint (read-write), depending on your actual needs.
- Endpoint: Database connection address (e.g.,
-
Configure Security Group
Ensure the RDS instance's security group allows access from VeloDB Cloud:
- In the Connectivity & security tab of the RDS instance details page, click the security group link under VPC security groups.
- Select the Inbound rules tab and click Edit inbound rules.
- Add rule:
- Type: MySQL/Aurora
- Port range: 3306 (or your custom port)
- Source:
- SaaS Mode: VeloDB Cloud connects to your VPC's IP address range via VPC Private Link.
- BYOC Mode: Your VPC CIDR or security group.
- Click Save rules.
-
Configure Database User Permissions
Connect to the RDS instance and create a user with appropriate permissions:
-- Create user
CREATE USER 'velodb_user'@'%' IDENTIFIED BY 'your_password';
-- Grant read-only permissions (recommended for query scenarios)
GRANT SELECT ON your_database.* TO 'velodb_user'@'%';
-- Or grant read-write permissions (if data writing is needed)
GRANT SELECT, INSERT, UPDATE, DELETE ON your_database.* TO 'velodb_user'@'%';
-- Flush privileges
FLUSH PRIVILEGES;Security Advice: Follow the principle of least privilege and grant only necessary database and table permissions.
Network Requirements
- VeloDB Cloud in SaaS Mode: Accessing your MySQL service requires allowing VeloDB to access your VPC. Please refer to velodb-accesses-your-vpc.
- VeloDB Cloud in BYOC Mode: Accessing your MySQL service requires referring to the network policy during deployment. Please refer to create-vpc-network-resources.
Create Catalog
Step 1: Enter Creation Page
- Log in to the VeloDB Cloud Console.
- Click Catalogs in the left navigation bar.
- Click the Add External Catalog button.
- Under the Database category, select MySQL.
Step 2: Configure Connection Information

| Field | Required | Description |
|---|---|---|
| Catalog Name | ✓ | Unique name for the Catalog, used to identify the data source in SQL queries. |
| Comment | Optional description. | |
| JDBC URL | ✓ | JDBC connection string for MySQL. Format is jdbc:mysql://<host>:<port>, optionally specifying the database name. |
| User | ✓ | Database username. |
| Password | ✓ | Database password. |
JDBC URL Examples:
- Basic format:
jdbc:mysql://mysql.example.com:3306 - Specify database:
jdbc:mysql://mysql.example.com:3306/mydb - With parameters:
jdbc:mysql://mysql.example.com:3306/mydb?useSSL=true
Step 3: Advanced Settings (Optional)
Click Advanced Settings to configure more options, such as connection pool size, timeout settings, etc.
Step 4: Confirm Creation
- Check configuration information.
- Click the Confirm button to create the Catalog.
Use Catalog
-- View database list
SHOW DATABASES FROM mysql_catalog;
-- View table list
SHOW TABLES FROM mysql_catalog.my_database;
-- Query data
SELECT * FROM mysql_catalog.my_database.my_table LIMIT 100;