<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged oci-networking</title>
<link>https://coderlegion.com/tag/oci-networking</link>
<description>Powered by Question2Answer</description>
<item>
<title>MySQL HeatWave: Connecting and Managing DB Systems</title>
<link>https://coderlegion.com/7226/mysql-heatwave-connecting-and-managing-db-systems</link>
<description>&lt;h2 id=&quot;mysql-heatwave-connecting-and-managing-db-systems&quot;&gt;MySQL HeatWave: Connecting and Managing DB Systems&lt;/h2&gt;
&lt;h3 id=&quot;introduction&quot;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;MySQL HeatWave provides a fully managed database service with robust connectivity options and comprehensive management capabilities. This guide covers DB system endpoints, secure connections, and lifecycle management through the OCI console and CLI tools.&lt;/p&gt;
&lt;h3 id=&quot;understanding-db-system-endpoints&quot;&gt;Understanding DB System Endpoints&lt;/h3&gt;
&lt;h4 id=&quot;endpoint-components&quot;&gt;Endpoint Components&lt;/h4&gt;
&lt;p&gt;A MySQL HeatWave DB system endpoint consists of three key elements:&lt;/p&gt;
&lt;h5 id=&quot;1-private-ip-address&quot;&gt;1. Private IP Address&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Assigned from the VCN subnet CIDR range&lt;/li&gt;
&lt;li&gt;Remains constant throughout the DB system's lifetime&lt;/li&gt;
&lt;li&gt;Not directly accessible from the public internet&lt;/li&gt;
&lt;li&gt;Provides secure, isolated connectivity&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;2-mysql-port-number-3306-&quot;&gt;2. MySQL Port Number (3306)&lt;/h5&gt;
&lt;p&gt;Port 3306 is the default port for MySQL protocol connections (used by MySQL Client and as backup by MySQL Shell). You can specify a port between 1024-65535 when creating the DB system.&lt;/p&gt;
&lt;h5 id=&quot;3-x-protocol-port-number-33060-&quot;&gt;3. X Protocol Port Number (33060)&lt;/h5&gt;
&lt;p&gt;Port 33060 is the default for X Protocol connections (used by MySQL Shell). Supports asynchronous operations, CRUD operations, document store functionality, and better performance for modern applications.&lt;/p&gt;
&lt;h4 id=&quot;platform-specific-differences&quot;&gt;Platform-Specific Differences&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;MySQL HeatWave on OCI&lt;/strong&gt;: Private IP addresses within VCN, requires network path through VCN/VPN/bastion&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MySQL HeatWave on AWS&lt;/strong&gt;: Public endpoint with FQDN, requires allowed client IPs in CIDR format, TLS 1.2 encryption&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MySQL HeatWave for Azure&lt;/strong&gt;: Hybrid networking between Azure VNet and OCI VCN with private connectivity&lt;/p&gt;
&lt;h3 id=&quot;network-path-requirements&quot;&gt;Network Path Requirements&lt;/h3&gt;
&lt;p&gt;Because DB systems use private IP addresses, you need one of these network paths:&lt;/p&gt;
&lt;h4 id=&quot;option-1-same-vcn&quot;&gt;Option 1: Same VCN&lt;/h4&gt;
&lt;p&gt;Connect from resources within the same VCN. Lowest latency, highest security, no additional networking costs.&lt;/p&gt;
&lt;h4 id=&quot;option-2-same-region-different-vcn-&quot;&gt;Option 2: Same Region (Different VCN)&lt;/h4&gt;
&lt;p&gt;Use VCN Peering or Dynamic Routing Gateway (DRG) to connect VCNs in the same region.&lt;/p&gt;
&lt;h4 id=&quot;option-3-on-premises-network&quot;&gt;Option 3: On-Premises Network&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Site-to-Site VPN&lt;/strong&gt;: IPSec VPN tunnel, up to 250 Mbps per tunnel&lt;br&gt;
&lt;strong&gt;FastConnect&lt;/strong&gt;: Dedicated physical connection, up to 10 Gbps bandwidth&lt;/p&gt;
&lt;h4 id=&quot;option-4-bastion-host&quot;&gt;Option 4: Bastion Host&lt;/h4&gt;
&lt;p&gt;Use OCI Bastion service or self-managed bastion host in public subnet for secure administrative access.&lt;/p&gt;
&lt;h4 id=&quot;option-5-oci-cloud-shell&quot;&gt;Option 5: OCI Cloud Shell&lt;/h4&gt;
&lt;p&gt;Browser-based terminal with pre-installed MySQL Shell. Free, no local setup required.&lt;/p&gt;
&lt;h3 id=&quot;connecting-to-mysql-heatwave&quot;&gt;Connecting to MySQL HeatWave&lt;/h3&gt;
&lt;h4 id=&quot;using-oci-cloud-shell&quot;&gt;Using OCI Cloud Shell&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Launch Cloud Shell from OCI Console
mysqlsh admin@10.0.1.100:3306 --sql

# Using X Protocol
mysqlsh admin@10.0.1.100:33060

# With database name
mysqlsh admin@10.0.1.100:3306/myapp_db --sql
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;using-compute-instance&quot;&gt;Using Compute Instance&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Install MySQL Shell (Oracle Linux/RHEL)&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo yum install -y mysql-shell
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Connect&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mysqlsh --host &amp;lt;DB_PRIVATE_IP&amp;gt; --port 3306 --user admin --password --sql
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;application-connections&quot;&gt;Application Connections&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import mysql.connector
config = {
    'user': 'admin',
    'password': 'your_password',
    'host': '10.0.1.100',
    'port': 3306,
    'database': 'myapp_db',
    'ssl_disabled': False
}
connection = mysql.connector.connect(**config)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Node.js&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;const mysql = require('mysql2');
const connection = mysql.createConnection({
  host: '10.0.1.100',
  port: 3306,
  user: 'admin',
  password: 'your_password',
  database: 'myapp_db',
  ssl: { rejectUnauthorized: true }
});
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;managing-db-systems&quot;&gt;Managing DB Systems&lt;/h3&gt;
&lt;h4 id=&quot;accessing-management-console&quot;&gt;Accessing Management Console&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Log in to OCI Console at cloud.oracle.com&lt;/li&gt;
&lt;li&gt;Navigate: Menu → Databases → HeatWave MySQL → DB Systems&lt;/li&gt;
&lt;li&gt;Select compartment and click DB system name&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;lifecycle-operations&quot;&gt;Lifecycle Operations&lt;/h4&gt;
&lt;h5 id=&quot;stop-a-db-system&quot;&gt;Stop a DB System&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: Stops compute billing (storage billing continues)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When to use&lt;/strong&gt;: Non-production environments, cost optimization during idle periods&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Impact&lt;/strong&gt;: Connections terminated, DB unavailable, HeatWave cluster also stops and reloads data on restart&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Console&lt;/strong&gt;: DB System details → Stop → Select shutdown type (Fast/Slow/Immediate) → Confirm&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql db-system stop --db-system-id &amp;lt;OCID&amp;gt; --shutdown-type FAST
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;start-an-inactive-db-system&quot;&gt;Start an Inactive DB System&lt;/h5&gt;
&lt;p&gt;Resume a stopped system. Billing resumes, HeatWave cluster automatically restarts and reloads data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql db-system start --db-system-id &amp;lt;OCID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Startup times&lt;/strong&gt;: Fast shutdown (2-5 min), Slow shutdown (1-3 min), Immediate shutdown (5-15 min)&lt;/p&gt;
&lt;h5 id=&quot;restart-an-active-db-system&quot;&gt;Restart an Active DB System&lt;/h5&gt;
&lt;p&gt;Shuts down then restarts immediately. Brief downtime (3-10 minutes), all connections terminated, uncommitted transactions rolled back.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql db-system restart --db-system-id &amp;lt;OCID&amp;gt; --shutdown-type FAST
&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;delete-a-db-system&quot;&gt;Delete a DB System&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;: Permanently deletes DB system and all data. Cannot be undone.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before deleting&lt;/strong&gt;: Create final backup, export critical data, check dependencies, review deletion policy&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Console&lt;/strong&gt;: DB System details → Delete → Choose backup retention → Type DB system name → Confirm&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql db-system delete --db-system-id &amp;lt;OCID&amp;gt; --force
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;understanding-db-system-states&quot;&gt;Understanding DB System States&lt;/h3&gt;
&lt;h4 id=&quot;state-indicators&quot;&gt;State Indicators&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Green (Active/Available)&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ACTIVE&lt;/strong&gt;: Fully operational, accepting connections&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UPDATING&lt;/strong&gt;: Configuration changes in progress&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Yellow (Transitional)&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CREATING&lt;/strong&gt;: Being provisioned (15-30 minutes)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;STARTING&lt;/strong&gt;: Booting up after stop&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;STOPPING&lt;/strong&gt;: Shutting down&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RESTARTING&lt;/strong&gt;: Shutdown + automatic startup&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Red (Failed/Error)&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;FAILED&lt;/strong&gt;: Operation failed, may require recreation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DELETING&lt;/strong&gt;: Deletion in progress&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Gray (Inactive/Deleted)&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;INACTIVE&lt;/strong&gt;: Stopped, no compute billing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DELETED&lt;/strong&gt;: Permanently removed&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;monitoring-states&quot;&gt;Monitoring States&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;CLI&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;oci mysql db-system get --db-system-id &amp;lt;OCID&amp;gt; --query 'data.&quot;lifecycle-state&quot;'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Expected transition times&lt;/strong&gt;: Creating (15-30 min), Stopping (2-5 min), Starting (3-10 min), Restarting (5-15 min), Deleting (10-20 min)&lt;/p&gt;
&lt;h3 id=&quot;db-system-details-page&quot;&gt;DB System Details Page&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;General Information&lt;/strong&gt;: Name, OCID, compartment, availability domain, MySQL version, HA status&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Configuration&lt;/strong&gt;: Shape, CPU/memory, storage capacity, configuration applied, endpoints/ports&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Networking&lt;/strong&gt;: VCN/subnet, private IP, security lists/NSGs, DNS hostname&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;HeatWave Cluster&lt;/strong&gt; (if attached): State, nodes, shape, memory, Lakehouse status&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Backups&lt;/strong&gt;: Policy settings, retention period, last backup time, PITR window&lt;/p&gt;
&lt;h3 id=&quot;security-best-practices&quot;&gt;Security Best Practices&lt;/h3&gt;
&lt;h4 id=&quot;1-network-security&quot;&gt;1. Network Security&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Deploy in private subnets only&lt;/li&gt;
&lt;li&gt;Security lists: Allow only ports 3306/33060 from known sources&lt;/li&gt;
&lt;li&gt;Use Network Security Groups for granular control&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;2-encryption&quot;&gt;2. Encryption&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;In Transit&lt;/strong&gt;: Always use SSL/TLS, TLS 1.2+&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;At Rest&lt;/strong&gt;: Enabled by default, Oracle-managed keys or BYOK&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;3-credential-management&quot;&gt;3. Credential Management&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Store passwords in OCI Vault&lt;/li&gt;
&lt;li&gt;Use principle of least privilege&lt;/li&gt;
&lt;li&gt;Create separate accounts per application&lt;/li&gt;
&lt;li&gt;Enable automatic password rotation&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;4-access-monitoring&quot;&gt;4. Access Monitoring&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Enable MySQL Enterprise Audit&lt;/li&gt;
&lt;li&gt;Enable VCN flow logs&lt;/li&gt;
&lt;li&gt;Monitor failed login attempts&lt;/li&gt;
&lt;li&gt;Regular audit log reviews&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;troubleshooting-common-issues&quot;&gt;Troubleshooting Common Issues&lt;/h3&gt;
&lt;h4 id=&quot;cannot-connect---connection-refused-&quot;&gt;Cannot Connect - &quot;Connection Refused&quot;&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Causes&lt;/strong&gt;: Security list not allowing MySQL ports, DB stopped, incorrect IP/port, no network path&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;: Verify DB is ACTIVE, check security lists (3306/33060), confirm private IP, test connectivity&lt;/p&gt;
&lt;h4 id=&quot;-access-denied-errors&quot;&gt;&quot;Access Denied&quot; Errors&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Causes&lt;/strong&gt;: Incorrect credentials, user doesn't exist, insufficient privileges&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;: Verify credentials, check user exists: &lt;code&gt;SELECT User, Host FROM mysql.user;&lt;/code&gt;, grant privileges&lt;/p&gt;
&lt;h4 id=&quot;-too-many-connections-&quot;&gt;&quot;Too Many Connections&quot;&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Causes&lt;/strong&gt;: Application connection leaks, &lt;code&gt;max_connections&lt;/code&gt; limit reached&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;: Check connections: &lt;code&gt;SHOW PROCESSLIST;&lt;/code&gt;, increase &lt;code&gt;max_connections&lt;/code&gt;, fix leaks, implement connection pooling&lt;/p&gt;
&lt;h4 id=&quot;slow-connection-establishment&quot;&gt;Slow Connection Establishment&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Causes&lt;/strong&gt;: DNS resolution delays, network latency&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;: Use IP instead of hostname, disable reverse DNS lookups, verify VCN routing&lt;/p&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Connecting to and managing MySQL HeatWave DB systems requires understanding networking concepts, endpoint configurations, and lifecycle operations. This guide covered:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DB system endpoints and network path requirements&lt;/li&gt;
&lt;li&gt;Multiple connection methods (Cloud Shell, Compute Instance, applications)&lt;/li&gt;
&lt;li&gt;Essential lifecycle operations (stop, start, restart, delete)&lt;/li&gt;
&lt;li&gt;DB system states and monitoring&lt;/li&gt;
&lt;li&gt;Security best practices&lt;/li&gt;
&lt;li&gt;Common troubleshooting scenarios&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whether connecting from Cloud Shell for quick administration or setting up production connectivity, MySQL HeatWave provides flexible, secure options for all your database needs.&lt;/p&gt;
</description>
<category>Database</category>
<guid isPermaLink="true">https://coderlegion.com/7226/mysql-heatwave-connecting-and-managing-db-systems</guid>
<pubDate>Wed, 12 Nov 2025 09:12:42 +0000</pubDate>
</item>
</channel>
</rss>