From 2702019ca5c084e38107e1e64b1d50bfe2ad98c9 Mon Sep 17 00:00:00 2001 From: <> Date: Mon, 19 Feb 2024 15:06:04 +0000 Subject: [PATCH] Deployed 9fd599c3 with MkDocs version: 1.5.3 --- .nojekyll | 0 404.html | 2002 +++++ .../Uptime SLA/index.html | 2361 ++++++ .../index.html | 2229 ++++++ .../MariaDB Enterprise Backup/index.html | 2968 ++++++++ .../Point-in-Time Recovery (PITR)/index.html | 2085 +++++ Backup and Restore/index.html | 2133 ++++++ Billing and Power Tier/Billing/index.html | 2178 ++++++ Billing and Power Tier/index.html | 2116 ++++++ Configure your Database Server(s)/index.html | 2658 +++++++ .../Connect from Java App/index.html | 2234 ++++++ .../Connect from MongoDB clients/index.html | 2098 ++++++ .../Connect from Node js App/index.html | 2360 ++++++ .../Connect from Python App/index.html | 2416 ++++++ .../index.html" | 2499 ++++++ .../index.html" | 2185 ++++++ .../Connect using Connector R2DBC/index.html | 2145 ++++++ .../Connect using ODBC/index.html | 2883 +++++++ Connecting to Sky DBs/index.html | 2206 ++++++ .../Import CSV data/index.html | 2289 ++++++ .../Import data from external DB/index.html | 2249 ++++++ .../Install Mariadb-dump/index.html | 2216 ++++++ .../Install mariadb-import/index.html | 2214 ++++++ .../index.html | 2135 ++++++ .../index.html | 2233 ++++++ Data loading, Migration/index.html | 2073 +++++ .../index.html | 2219 ++++++ Data offloading/index.html | 2158 ++++++ FAQs/index.html | 3261 ++++++++ FractionalDBA/index.html | 2287 ++++++ Portal features/Launch page/index.html | 2133 ++++++ .../Manage your Service/index.html | 2182 ++++++ Portal features/Notifications/index.html | 2156 ++++++ .../Service Details page/index.html | 2109 ++++++ .../Service Monitoring Panels/index.html | 3658 +++++++++ Portal features/index.html | 2365 ++++++ .../Launch DB using the REST API/index.html | 2510 ++++++ .../index.html | 2961 ++++++++ Quickstart/Untitled 1.png | Bin 0 -> 298002 bytes Quickstart/Untitled.png | Bin 0 -> 196661 bytes Quickstart/index.html | 2266 ++++++ .../Instance Size Choices/index.html | 2620 +++++++ Reference Guide/MaxScale Reference/index.html | 3718 +++++++++ .../Monitoring Metrics Reference/index.html | 3869 ++++++++++ Reference Guide/REST API Reference/index.html | 2432 ++++++ Reference Guide/Region Choices/index.html | 2296 ++++++ .../Sky Stored Procedures/index.html | 2451 ++++++ Reference Guide/index.html | 2176 ++++++ Scaling horizontally, HA/index.html | 2082 +++++ Security/Configuring Firewall/index.html | 2247 ++++++ Security/Managing API keys/index.html | 2473 ++++++ Security/Managing Portal Users/index.html | 2261 ++++++ Security/Portal Single Sign-On/index.html | 2158 ++++++ Security/Private VPC connections/index.html | 2081 +++++ Security/index.html | 2079 +++++ .../Setting up AWS Private Link/index.html | 2669 +++++++ .../index.html | 2758 +++++++ .../index.html | 2075 +++++ architecture.png | Bin 0 -> 413992 bytes assets/favicon.png | Bin 0 -> 30390 bytes assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.8fd75fb4.min.js | 29 + assets/javascripts/bundle.8fd75fb4.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.b8dbb3d2.min.js | 42 + .../workers/search.b8dbb3d2.min.js.map | 7 + assets/sky_logo.png | Bin 0 -> 66591 bytes assets/sky_logo2.png | Bin 0 -> 30390 bytes assets/stylesheets/main.7e359304.min.css | 1 + assets/stylesheets/main.7e359304.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + index.html | 2066 +++++ search/search_index.json | 1 + sitemap.xml | 3 + sitemap.xml.gz | Bin 0 -> 127 bytes stylesheets/extra.css | 6 + 110 files changed, 141241 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 Autonomously scale Compute, Storage/Uptime SLA/index.html create mode 100644 Autonomously scale Compute, Storage/index.html create mode 100644 Backup and Restore/MariaDB Enterprise Backup/index.html create mode 100644 Backup and Restore/Point-in-Time Recovery (PITR)/index.html create mode 100644 Backup and Restore/index.html create mode 100644 Billing and Power Tier/Billing/index.html create mode 100644 Billing and Power Tier/index.html create mode 100644 Configure your Database Server(s)/index.html create mode 100644 Connecting to Sky DBs/Connect from Java App/index.html create mode 100644 Connecting to Sky DBs/Connect from MongoDB clients/index.html create mode 100644 Connecting to Sky DBs/Connect from Node js App/index.html create mode 100644 Connecting to Sky DBs/Connect from Python App/index.html create mode 100644 "Connecting to Sky DBs/Connect from \342\200\230C++\342\200\231 App/index.html" create mode 100644 "Connecting to Sky DBs/Connect from \342\200\230C\342\200\231 App/index.html" create mode 100644 Connecting to Sky DBs/Connect using Connector R2DBC/index.html create mode 100644 Connecting to Sky DBs/Connect using ODBC/index.html create mode 100644 Connecting to Sky DBs/index.html create mode 100644 Data loading, Migration/Import CSV data/index.html create mode 100644 Data loading, Migration/Import data from external DB/index.html create mode 100644 Data loading, Migration/Install Mariadb-dump/index.html create mode 100644 Data loading, Migration/Install mariadb-import/index.html create mode 100644 Data loading, Migration/Migrating your existing Production DB/index.html create mode 100644 Data loading, Migration/Replicating data from external DB/index.html create mode 100644 Data loading, Migration/index.html create mode 100644 Data offloading/Replicating data from SkySQL to external database/index.html create mode 100644 Data offloading/index.html create mode 100644 FAQs/index.html create mode 100644 FractionalDBA/index.html create mode 100644 Portal features/Launch page/index.html create mode 100644 Portal features/Manage your Service/index.html create mode 100644 Portal features/Notifications/index.html create mode 100644 Portal features/Service Details page/index.html create mode 100644 Portal features/Service Monitoring Panels/index.html create mode 100644 Portal features/index.html create mode 100644 Quickstart/Launch DB using the REST API/index.html create mode 100644 Quickstart/Launch DB using the Terraform Provider/index.html create mode 100644 Quickstart/Untitled 1.png create mode 100644 Quickstart/Untitled.png create mode 100644 Quickstart/index.html create mode 100644 Reference Guide/Instance Size Choices/index.html create mode 100644 Reference Guide/MaxScale Reference/index.html create mode 100644 Reference Guide/Monitoring Metrics Reference/index.html create mode 100644 Reference Guide/REST API Reference/index.html create mode 100644 Reference Guide/Region Choices/index.html create mode 100644 Reference Guide/Sky Stored Procedures/index.html create mode 100644 Reference Guide/index.html create mode 100644 Scaling horizontally, HA/index.html create mode 100644 Security/Configuring Firewall/index.html create mode 100644 Security/Managing API keys/index.html create mode 100644 Security/Managing Portal Users/index.html create mode 100644 Security/Portal Single Sign-On/index.html create mode 100644 Security/Private VPC connections/index.html create mode 100644 Security/index.html create mode 100644 Using AWS GCP private VPC connections/Setting up AWS Private Link/index.html create mode 100644 Using AWS GCP private VPC connections/Setting up GCP Private Service Connect/index.html create mode 100644 Using AWS GCP private VPC connections/index.html create mode 100644 architecture.png create mode 100644 assets/favicon.png create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.8fd75fb4.min.js create mode 100644 assets/javascripts/bundle.8fd75fb4.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js.map create mode 100644 assets/sky_logo.png create mode 100644 assets/sky_logo2.png create mode 100644 assets/stylesheets/main.7e359304.min.css create mode 100644 assets/stylesheets/main.7e359304.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 index.html create mode 100644 search/search_index.json create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 stylesheets/extra.css diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..feec20e8 --- /dev/null +++ b/404.html @@ -0,0 +1,2002 @@ + + + +
+ + + + + + + + + + + + + + +MariaDB SkySQL customers should assess the availability requirements of their application and choose an appropriate service tier to meet their objectives. MariaDB SkySQL customers are on the Foundation Tier unless they have specifically purchased and paid for Power Tier service.
+Tier | +Performance Standard | +
---|---|
SkySQL Foundation Tier | +ā¢ Multi-node configurations will deliver a 99.95% service availability on a per-billing-month basis. | +
ā¢ For example, with this availability target in a 30 day calendar month the maximum service downtime is 21 minutes and 54 seconds. | ++ |
SkySQL Power Tier | +ā¢ Multi-node configurations will deliver a 99.995% service availability on a per-billing-month basis. | +
ā¢ For example, with this availability target in a 30 day calendar month the maximum service downtime is 2 minutes and 11 seconds. | ++ |
Service DowntimeĀ is measured at each SkySQL database endpoint as the total number of full minutes, outside of scheduled downtime for maintenance and upgrades, where continuous attempts to establish a connection within the minute fail as reflected in minute-by-minute logs.
+Monthly Uptime PercentageĀ is calculated on a per-billing-month basis as the total number of minutes in a month, minus the number of minutes of measuredĀ Service DowntimeĀ within the month, divided by the number of minutes in that month. When a service is deployed for only part of a month, it is assumed to be 100% available for the portion of the month that it is not deployed.
+Service CreditĀ is the percentage of the total fees paid by you for a given SkySQL service during the month in which the downtime occurred to be credited if MariaDB approves your claim. The percentage used in calculating Service Credit is dependent on whether the customer is on Foundation Tier or Power Tier, and is dependent on the calculatedĀ Monthly Uptime Percentage.
+Tier | +Monthly Uptime Percentage | +Percentage Applied | +
---|---|---|
Foundation Tier | +Less than 99.95%, but greater than or equal to 99.0% | +10% | +
Foundation Tier | +Less than 99.0% | +25% | +
Power Tier | +Less than 99.995%, but greater than or equal to 99.0% | +10% | +
Power Tier | +Less than 99.0% | +25% | +
MariaDB will grant and process claims, provided the customer has satisfied itsĀ Customer ObligationsĀ and that none of theĀ ExclusionsĀ listed apply to the claim.Ā Service CreditsĀ will be issued only upon request within 60 days of the end of the billing period of the month of impact to service availability, and upon confirmation of outage.Ā Service CreditsĀ will be issued in the form of a monetary credit applied to future use of the service that experienced theĀ Service Downtime.Ā Service CreditsĀ will not be applied to fees for any other SkySQL instance.
+The aggregate maximum number ofĀ Service CreditsĀ to be issued by MariaDB to customers for any and allĀ Service DowntimeĀ that occurs in a single billing month will not exceed 50% of the amount due from the customer for the covered service for the applicable month.
+A customer will forfeit their right to receive aĀ Service CreditĀ unless they:
+Out-of-scope configurations
+TheĀ Performance StandardĀ does not apply to single instance SkySQL service configuration or services in Technical Preview. Customers requiring High Availability should deploy instead in production-ready multi-node service configuration.
+See "Choose a SkySQL Release" for information on SkySQL services in Technical Preview.
+Underlying infrastructure
+Impact to service availability caused by availability or performance of cloud services used to operate MariaDB SkySQL is excluded. This includes any such outages in Amazon Web Services (AWS) and Amazon Elastic Kubernetes Service (EKS), and Google Cloud Platform (GCP) and Google Kubernetes Engine (GKE).
+Network interruption
+Impact to service availability caused by blocking of network traffic by ISPs, network providers, governments, or third parties is excluded.
+External factors
+Impact to your use of service based on factors outside MariaDB SkySQL are excluded. This includes periods of downtime for your applications.
+Uncorroborated impacts
+Only impacts to service availability detected atĀ point of measurementĀ are subject when determining the uptime percentage. Service availability impacts measured through any other means, such as application instrumentation, are excluded except as also measured asĀ Service DowntimeĀ by MariaDB.
+Portal access
+Impact to your ability to access or use the MariaDB SkySQL portal, an interface provided to manage services, is excluded. This includes any component and content linked from the MariaDB SkySQL portal, including Documentation, the Customer Support portal, Monitoring, and Workload Analysis. These components operate independently from database services and do not impact database availability.
+Resource usage
+Impact to service availability caused by usage of system resources, such as problems caused by excessive workload consumption of CPU, disk I/O, disk capacity, memory, and other system resources, are excluded.
+Clients and connectors
+Impact to service availability caused by the use of unsupported third-party clients and connectors is excluded.
+Non-paying customers
+TheĀ Performance StandardĀ applies only to paying MariaDB SkySQL customers who are paid-in-full. All other MariaDB SkySQL customers, including those not paid-in-full and those customers participating in a free or credited service trial, are excluded.
+Customer-directed maintenance
+When a customer directs that MariaDB conduct a maintenance operation on a service, any resulting impact to service availability is excluded.
+Customer-approved maintenance
+When a customer approves MariaDB-recommended maintenance on a service, any resulting impact to service availability is excluded.
+Customer-initiated changes
+When a customer initiates changes to their SkySQL services, e.g., via access to the database or via the SkySQL portal, any resulting impact to service availability is excluded.
+Initial provisioning
+Availability of services during initial provisioning, e.g., before a service becomes online, healthy, and available, is excluded.
+Autonomous features enable automatic scaling in response to changes in workload.
+Auto-scale of nodes enables scaling based on load:
+Auto-scale of storage enables expansion of capacity based on usage.
+Autonomous features can be enabled at time ofĀ service launch. Autonomous features can be enabled or disabled after launch.
+ +Auto-scaling of nodes can be enabled either at time of service launch or after service launch.
+DuringĀ service launch:
+After service launch,Ā manage Autonomous settings, and enable the desired auto-scaling features.
+Auto-scaling of storage can be enabled either at time of service launch or after service launch.
+DuringĀ Service Launch:
+After service launch,Ā manage Autonomous settings, and enable the desired auto-scaling features.
+For ColumnStore Data Warehouse, object storage adjusts automatically. Autonomous scaling features for storage are not used by this topology.
+To manage Autonomous settings:
+Automatic scaling occurs based on rules.
+Policy | +Condition | +Action | +
---|---|---|
Auto-Scale Disk | +ā¢ Disk utilization > 90% sustained for 5 minutes | ++ |
The disk is expected to run out of capacity in the next 24 hours (predicted based on the last 6 hours of service usage) | +ā¢ Upgrade storage to the next available size in 100GB increments | ++ |
ā¢ Note: you cannot downgrade storage, the upgrade is irreversible | ++ | + |
Auto-Scale Nodes Out | +ā¢ CPU utilization > 75% over all replicas sustained for 30 minutes | ++ |
ā¢ Number of concurrent sessions > 90% over all replicas sustained for 1 hour | ++ | + |
ā¢ Number of concurrent sessions is expected to hit the maximum within 4 hours (predicted based on the last 2 hours of service usage) | +ā¢ Add new replica or node | ++ |
ā¢ Additional nodes will be of the same size and configuration as existing nodes | ++ | + |
Auto-Scale Nodes In | +ā¢ CPU utilization < 50% over all replicas sustained for 1 hour | ++ |
ā¢ Number of concurrent sessions < 50% over all replicas sustained for 1 hour | +ā¢ Remove replica or node | ++ |
ā¢ Node count will not decrease below the initial count set at launch | ++ | + |
Auto-Scale Nodes Up | +ā¢ Number of concurrent sessions is expected to hit the maximum within 4 hours (predicted based on the last 2 hours of service usage) | +ā¢ Upgrade all nodes to the next available size | +
Auto-Scale Nodes Down | +ā¢ CPU utilization < 50% over all replicas sustained for 1 hour | ++ |
ā¢ Number of concurrent sessions < 50% over all replicas sustained for 1 hour | +ā¢ Downgrade nodes | ++ |
ā¢ Node size will not decrease below the initial node size set at launch | ++ | + |
Autonomous actions are not instantaneous.
+Cooldown periods may apply. A cooldown period is the time period after a scaling operation is completed before another scaling operation can occur. The cooldown period for storage scaling is 6 hours.
+ + + + + + + + + + + + + + +Note
+TODO - rough draft below .. needs to be cleaned up
+Regular and reliable backups are essential to successful recovery of mission critical applications.Ā MariaDB Enterprise ServerĀ backup and restore operations are performed usingĀ MariaDB Enterprise Backup, anĀ enterprise-buildĀ ofĀ MariaDB Backup.
+MariaDB Enterprise BackupĀ is compatible with MariaDB Enterprise Server 10.2, 10.3, 10.4, 10.5, and 10.6.
+MariaDB Enterprise Backup creates a file-level backup of data from the MariaDB Enterprise Server data directory. This backup includesĀ temporal data, and the encrypted and unencrypted tablespaces of supported storage engines (e.g.,Ā InnoDB,Ā MyRocks,Ā Aria).
+MariaDB Enterprise Server implements:
+Backup support is specific to storage engines. All supported storage engines enable full backup. The InnoDB storage engine additionally supports incremental backup.
+A feature of MariaDB Enterprise Backup and MariaDB Enterprise Server, non-blocking backups minimize workload impact during backups. When MariaDB Enterprise Backup connects to MariaDB Enterprise Server, staging operations are initiated to protect data during read.
+Non-blocking backup functionality differs from historical backup functionality in the following ways:
+FLUSHĀ TABLESĀ WITHĀ READĀ LOCK
, which closed open tables and only allowed tables to be reopened with a read lock during the duration of backups.MariaDB Enterprise Backup creates complete or incremental backups of MariaDB Enterprise Server data, and is also used to restore data from backups produced using MariaDB Enterprise Backup.
+Full backups produced using MariaDB Enterprise Server are not initially point-in-time consistent, and an attempt to restore from a raw full backup will cause InnoDB to crash to protect the data.
+Incremental backups produced using MariaDB Enterprise Backup contain only the changes since the last backup and cannot be used standalone to perform a restore.
+To restore from a backup, you first need to prepare the backup for point-in-time consistency using theĀ --prepare
Ā command:
-prepare
Ā command on aĀ full backupĀ synchronizes the tablespaces, ensuring that they are point-in-time consistent and ready for use in recovery.-prepare
Ā command on anĀ incremental backupĀ synchronizes the tablespaces and also applies the updated data into the previous full backup, making it a complete backup ready for use in recovery.-prepare
Ā command on data that is to be used for aĀ partial restoreĀ (when restoring only one or more selected tables) requires that you also use theĀ -export
Ā option to create the necessaryĀ .cfg
Ā files to use in recovery.When MariaDB Enterprise Backup restores from a backup, it copies or moves the backup files into the MariaDB Enterprise Server data directory, as defined by theĀ datadir
Ā system variable.
For MariaDB Enterprise Backup to safely restore data from full and incremental backups, the data directory must be empty. One way to achieve this is to move the data directory aside to a unique directory name:
+/var/lib/mysql-2020-01-01
)Ā ORĀ remove the old data directory (depending on how much space you have available).mkdirĀ /var/lib/mysql
).chownĀ -RĀ mysql:mysqlĀ /var/lib/mysql
).When MariaDB Enterprise Backup performs a backup operation, it not only copies files from the data directory but also connects to the running MariaDB Enterprise Server.
+This connection to MariaDB Enterprise Server is used to manage locks and backup staging that prevent the Server from writing to a file while being read for a backup.
+MariaDB Enterprise Backup establishes this connection based on the user credentials specified with theĀ --user
Ā andĀ --password
Ā options when performing a backup.
It is recommended that a dedicated user be created and authorized to perform backups.
+MariaDB Enterprise Backup 10.5 and later requires this user to have theĀ RELOAD
,Ā PROCESS
,Ā LOCKĀ TABLES
, andĀ BINLOGĀ MONITOR
Ā privileges. (TheĀ BINLOG MONITORĀ privilege replaced theĀ REPLICATIONĀ CLIENT
Ā privilege in MariaDB Enterprise Server 10.5.):
**CREATE** **USER** 'mariabackup'@'localhost'IDENTIFIED **BY** 'mbu_passwd'**;GRANT** RELOAD**,** PROCESS**,** **LOCK** TABLES**,** BINLOG MONITOR**ON** ***.*****TO** 'mariabackup'@'localhost'**;**
In the above example, MariaDB Enterprise Backup would run on the local system that runs MariaDB Enterprise Server. Where backups may be run against a remote server, the user authentication and authorization should be adjusted.
+While MariaDB Enterprise Backup requires a user for backup operations, no user is required for restore operations since restores occur while MariaDB Enterprise Server is not running.
+MariaDB Enterprise Backup 10.4 and earlier requires this user to have theĀ RELOAD
,Ā PROCESS
,Ā LOCKĀ TABLES
, andĀ REPLICATIONĀ CLIENT
Ā privileges. (TheĀ BINLOG MONITORĀ privilege replaced theĀ REPLICATIONĀ CLIENT
Ā privilege in MariaDB Enterprise Server 10.5.):
**CREATE** **USER** 'mariabackup'@'localhost'IDENTIFIED **BY** 'mbu_passwd'**;GRANT** RELOAD**,** PROCESS**,** **LOCK** TABLES**,** REPLICATION CLIENT**ON** ***.*****TO** 'mariabackup'@'localhost'**;**
In the above example, MariaDB Enterprise Backup would run on the local system that runs MariaDB Enterprise Server. Where backups may be run against a remote server, the user authentication and authorization should be adjusted.
+While MariaDB Enterprise Backup requires a user for backup operations, no user is required for restore operations since restores occur while MariaDB Enterprise Server is not running.
+Full backups performed with MariaDB Enterprise Backup contain all table data present in the database.
+When performing a full backup, MariaDB Enterprise Backup makes a file-level copy of the MariaDB Enterprise Server data directory. This backup omits log data such as the binary logs (binlog), error logs, general query logs, and slow query logs.
+When you perform a full backup, MariaDB Enterprise Backup writes the backup to theĀ --target-dir
Ā path. The directory must be empty or non-existent and the operating system user account must have permission to write to that directory. A database user account is required to perform the backup.
The version ofĀ mariabackup
Ā orĀ mariadb-backup
Ā should be the same version as the MariaDB Enterprise Server version. When the version does not match the server version, errors can sometimes occur, or the backup can sometimes be unusable.
To create a backup, executeĀ mariabackup
Ā orĀ mariadb-backup
Ā with theĀ [--backup](https://mariadb.com/docs/server/ref/mdb/cli/mariadb-backup/backup/)
Ā option, and provide the database user account credentials using theĀ [--user](https://mariadb.com/docs/server/ref/mdb/cli/mariadb-backup/user/)
Ā andĀ [--password](https://mariadb.com/docs/server/ref/mdb/cli/mariadb-backup/password/)
Ā options:
$ sudo mariabackup --backup \ --target-dir=/data/backups/full \ --user=mariabackup \ --password=mbu_passwd
Subsequent to the above example, the backup is now available in the designatedĀ --target-dir
Ā path.
A raw full backup is notĀ point-in-time consistentĀ and must be prepared before it can be used for a restore. The backup can be prepared any time after the backup is created and before the backup is restored. However, MariaDB recommends preparing a backup immediately after taking the backup to ensure that the backup is consistent.
+The backup should be prepared with the same version of MariaDB Enterprise Backup that was used to create the backup.
+To prepare the backup, executeĀ mariabackup
Ā orĀ mariadb-backup
Ā with theĀ [--prepare](https://mariadb.com/docs/server/ref/mdb/cli/mariadb-backup/prepare/)
Ā option:
$ sudo mariabackup --prepare \ --use-memory=34359738368 \ --target-dir=/data/backups/full
For best performance, theĀ [--use-memory](https://mariadb.com/docs/server/ref/mdb/cli/mariadb-backup/use-memory/)
Ā option should be set to the server'sĀ [innodb_buffer_pool_size](https://mariadb.com/docs/server/ref/mdb/system-variables/innodb_buffer_pool_size/)
Ā value.
Once a full backup has beenĀ preparedĀ to be point-in-time consistent, MariaDB Enterprise Backup is used to copy backup data to the MariaDB Enterprise Server data directory.
+To restore from a full backup:
+Restore from the "full" directory using theĀ -copy-back
Ā option:
$ sudo mariabackup --copy-back --target-dir=/data/backups/full
MariaDB Enterprise Backup writes to the data directory as the current user, which can be changed usingĀ sudo
. To confirm that restored files are properly owned by the user that runs MariaDB Enterprise Server, run a command like this (adapted for the correct user/group):
$ sudo chown -R mysql:mysql /var/lib/mysql
Once this is done, start MariaDB Enterprise Server:
+$ sudo systemctl start mariadb
When the Server starts, it works from the restored data directory.
+Full backups of large data-sets can be time-consuming and resource-intensive. MariaDB Enterprise Backup supports the use of incremental backups to minimize this impact.
+While full backups are resource-intensive at time of backup, the resource burden around incremental backups occurs when preparing for restore. First, the full backup is prepared for restore, then each incremental backup is applied.
+When you perform an incremental backup, MariaDB Enterprise Backup compares a previous full or incremental backup to what it finds on MariaDB Enterprise Server. It then creates a new backup containing the incremental changes.
+Incremental backup is supported for InnoDB tables. Tables using other storage engines receive full backups even during incremental backup operations.
+To increment a full backup, use theĀ --incremental-basedir
Ā option to indicate the path to the full backup and theĀ --target-dir
Ā option to indicate where you want to write the incremental backup:
$ sudo mariabackup --backup \ --incremental-basedir=/data/backups/full \ --target-dir=/data/backups/inc1 \ --user=mariabackup \ --password=mbu_passwd
In this example, MariaDB Enterprise Backup reads theĀ /data/backups/full
Ā directory, and MariaDB Enterprise Server then creates an incremental backup in theĀ /data/backups/inc1
Ā directory.
An incremental backup must be applied to a prepared full backup before it can be used in a restore operation. If you have multiple full backups to choose from, pick the nearest full backup prior to the incremental backup that you want to restore. You may also want to back up your full-backup directory, as it will be modified by the updates in the incremental data.
+If your full backup directory is not yet prepared, run this to make it consistent:
+$ sudo mariabackup --prepare --target-dir=/data/backups/full
Then, using the prepared full backup, apply the first incremental backup's data to the full backup in an incremental preparation step:
+$ sudo mariabackup --prepare \ --target-dir=/data/backups/full \ --incremental-dir=/data/backups/inc1
Once the incremental backup has been applied to the full backup, the full backup directory contains the changes from the incremental backup (that is, theĀ inc1/
Ā directory). Feel free to removeĀ inc1/
Ā to save disk space.
Once you have prepared the full backup directory with all the incremental changes you need (as described above), stop the MariaDB Enterprise Server,Ā emptyĀ its data directory, and restore from the original full backup directory using theĀ --copy-back
Ā option:
$ sudo mariabackup --copy-back --target-dir=/data/backups/full
MariaDB Enterprise Backup writes files into the data directory using either the current user or root (in the case of a sudo operation), which may be different from the system user that runs the database. Run the following to recursively update the ownership of the restored files and directories:
+$ sudo chown -R mysql:mysql /var/lib/mysql
Then, start MariaDB Enterprise Server. When the Server starts, it works from the restored data directory.
+In a partial backup, MariaDB Enterprise Backup copies a specified subset of tablespaces from the MariaDB Enterprise Server data directory. Partial backups are useful in establishing a higher frequency of backups on specific data, at the expense of increased recovery complexity. In selecting tablespaces for a partial backup, please consider referential integrity.
+Command-line options can be used to narrow the set of databases or tables to be included within a backup:
+Option | +Description | +
---|---|
--databases | +List of databases to include | +
--databases-exclude | +List of databases to omit from the backup | +
--databases-file | +Path to file listing the databases to include | +
--tables | +List of tables to include | +
--tables-exclude | +List of tables to exclude | +
--tables-file | +Path to file listing the tables to include | +
For example, you may wish to produce a partial backup, which excludes a specific database:
+$ sudo mariabackup --backup \ --target-dir=/data/backups/part \ --user=mariabackup \ --password=mbu_passwd \ --database-exclude=test
Partial backups can also be incremental:
+$ sudo mariabackup --backup \ --incremental-basedir=/data/backups/part \ --target-dir=/data/backups/part_inc1 \ --user=mariabackup \ --password=mbu_passwd \ --database-exclude=test
As with full and incremental backups, partial backups are not point-in-time consistent. A partial backup must be prepared before it can be used for recovery.
+A partial restore can be performed from a full backup or partial backup.
+The preparation step for either partial or full backup restoration requires the use of transportable tablespaces for InnoDB. As such, each prepare operation requires theĀ --export
Ā option:
$ sudo mariabackup --prepare --export --target-dir=/data/backups/part
When using a partial incremental backup for restore, the incremental data must be applied to its prior partial backup data before its data is complete. If performing partial incremental backups, run the prepare statement again to apply the incremental changes onto the partial backup that served as the base.
+$ sudo mariabackup --prepare --export \ --target-dir=/data/backups/part \ --incremental-dir=/data/backups/part_inc1
Unlike full and incremental backups, you cannot restore partial backups directly using MariaDB Enterprise Backup. Further, as a partial backup does not contain a complete data directory, you cannot restore MariaDB Enterprise Server to a startable state solely with a partial backup.
+To restore from a partial backup, you need to prepare a table on the MariaDB Enterprise Server, then manually copy the files into the data directory.
+The details of the restore procedure depend on the characteristics of the table:
+As partial restores are performed while the server is running, not stopped, care should be taken to prevent production workloads during restore activity.
+Note
+You can also use data from a full backup in a partial restore operation if you have prepared the data using theĀ --export
Ā option as described above.
To restore a non-partitioned table from a backup, first create a new table on MariaDB Enterprise Server to receive the restored data. It should match the specifications of the table you're restoring.
+Be extra careful if the backup data is from a server with a different version than the restore server, as some differences (such as a differingĀ ROW_FORMAT
) can cause an unexpected result.
Create an empty table for the data being restored:
+**CREATE** **TABLE** test**.**address_book **(** id INT **PRIMARY** **KEY** AUTO_INCREMENT**,** name VARCHAR**(**255**),** email VARCHAR**(**255**));**
Modify the table to discard the tablespace:
+**ALTER** **TABLE** test**.**address_book DISCARD TABLESPACE**;**
You can copy (or move) the files for the table from the backup to the data directory:
+$ sudo cp /data/backups/part_inc1/test/address_book.* /var/lib/mysql/test
Use a wildcard to include both theĀ .ibd
Ā andĀ .cfg
Ā files. Then, change the owner to the system user running MariaDB Enterprise Server:
$ sudo chown mysql:mysql /var/lib/mysql/test/address_book.*
Lastly, import the new tablespace:
+**ALTER** **TABLE** test**.**address_book IMPORT TABLESPACE**;**
MariaDB Enterprise Server looks in the data directory for the tablespace you copied in, then imports it for use. If the table is encrypted, it also looks for the encryption key with the relevant key ID that the table data specifies.
+Repeat this step for every table you wish to restore.
+Restoring a partitioned table from a backup requires a few extra steps compared to restoring a non-partitioned table.
+To restore a partitioned table from a backup, first create a new table on MariaDB Enterprise Server to receive the restored data. It should match the specifications of the table you're restoring, including the partition specification.
+Be extra careful if the backup data is from a server with a different version than the restore server, as some differences (such as a differingĀ ROW_FORMAT
) can cause an unexpected result.
Create an empty table for the data being restored:
+**CREATE** **TABLE** test**.**students **(** id INT **NOT** **NULL** AUTO_INCREMENT**,** name VARCHAR**(**255**),** email VARCHAR**(**255**),** graduating_year **YEAR,** **PRIMARY** **KEY** **(**id**,** graduating_year**))** ENGINE = InnoDBPARTITION **BY** RANGE **(**graduating_year**)** **(** PARTITION p0 **VALUES** **LESS** **THAN** **(**2019**),** PARTITION p1 **VALUES** **LESS** **THAN** **MAXVALUE);**
Then create a second empty table matching the column specification, but without partitions. This will be your working table:
+**CREATE** **TABLE** test**.**students_work **ASSELECT** * **FROM** test**.**students **WHERE** **NULL;**
For each partition you want to restore, discard the working table's tablespace:
+**ALTER** **TABLE** test**.**students_work DISCARD TABLESPACE**;**
Then, copy the table files from the backup, using the new name:
+$ sudo cp /data/backups/part_inc1/test/students.ibd /var/lib/mysql/test/students_work.ibd
+$ sudo cp /data/backups/part_inc1/test/students.cfg /var/lib/mysql/test/students_work.cfg
Change the owner to that of the user running MariaDB Enterprise Server:
+$ sudo chown mysql:mysql /var/lib/mysql/test/students_work.*
Import the copied tablespace:
+**ALTER** **TABLE** test**.**students_work IMPORT TABLESPACE**;**
Lastly, exchange the partition, copying the tablespace from the working table into the partition file for the target table:
+**ALTER** **TABLE** test**.**students EXCHANGE PARTITION p0 **WITH** **TABLE** test**.**students_work**;**
Repeat the above process for each partition until you have them all exchanged into the target table. Then delete the working table, as it's no longer necessary:
+**DROP** **TABLE** test**.**students_work**;**
This restores a partitioned table.
+When restoring a table with a full-text search (FTS) index, InnoDB may throw a schema mismatch error.
+In this case, to restore the table, it is recommended to:
+.cfg
Ā file.For example, to restore tableĀ t1
Ā with FTS index from databaseĀ db1
:
In the MariaDB shell, drop the table you are going to restore:
+**DROP** **TABLE** **IF** **EXISTS** db1**.**t1**;**
Create an empty table for the data being restored:
+**CREATE** **TABLE** db1**.**t1**(**f1 CHAR**(**10**))** ENGINE=INNODB**;**
Modify the table to discard the tablespace:
+**ALTER** **TABLE** db1**.**t1 DISCARD TABLESPACE**;**
In the operating system shell, copy the table files from the backup to the data directory of the corresponding database:
+$ sudo cp /data/backups/part/db1/t1.* /var/lib/mysql/db1
Remove theĀ .cfg
Ā file from the data directory:
$ sudo rm /var/lib/mysql/db1/t1.cfg
Change the owner of the newly copied files to the system user running MariaDB Enterprise Server:
+$ sudo chown mysql:mysql /var/lib/mysql/db1/t1.*
In the MariaDB shell, import the copied tablespace:
+**ALTER** **TABLE** db1**.**t1 IMPORT TABLESPACE**;**
Verify that the data has been successfully restored:
+**SELECT** * **FROM** db1**.**t1**;**
+--------+
+| f1 |
++--------+
+| ABC123 |
++--------+
Add the necessary secondary indexes:
+**ALTER** **TABLE** db1**.**t1 **FORCE,** **ADD** FULLTEXT **INDEX** f_idx**(**f1**);**
The table is now fully restored:
+**SHOW** **CREATE** **TABLE** db1**.**t1**\G**
*************************** 1. row ***************************
+ Table: t1
+Create Table: CREATE TABLE `t1` (
+ `f1` char(10) DEFAULT NULL,
+ FULLTEXT KEY `f_idx` (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
+
Recovering from a backup restores the data directory at a specific point-in-time, but it does not restore the binary log. In a point-in-time recovery, you begin by restoring the data directory from a full or incremental backup, then use theĀ mysqlbinlog
Ā utility to recover the binary log data to a specific point in time.
First, prepare the backup as you normally would for aĀ fullĀ orĀ incrementalĀ backup:
+$ sudo mariabackup --prepare --target-dir=/data/backups/full
When MariaDB Enterprise Backup runs on a MariaDB Enterprise Server where binary logs is enabled, it stores binary log information in theĀ xtrabackup_binlog_info
Ā file. Consult this file to find the name of the binary log position to use. In the following example, the log position isĀ 321
.
`$ sudo cat /data/backups/full/xtraback_binlog_info
+mariadb-node4.00001 321`
+Update the configuration file to use a new data directory.
+**[mysqld]**datadir=/var/lib/mysql_new
Using MariaDB Enterprise Backup, restore from the backup to the new data directory:
+$ sudo mariabackup --copy-back --target-dir=/data/backups/full
Then change the owner to the MariaDB Enterprise Server system user:
+$ sudo chown -R mysql:mysql /var/lib/mysql_new
Start MariaDB Enterprise Server:
+$ sudo systemctl start mariadb
Using the binary log file in the old data directory, the start position in theĀ xtrabackup_binlog_info
Ā file, the date and time you want to restore to, and theĀ mysqlbinlog
Ā utility to create an SQL file with the binary log changes:
$ mysqlbinlog --start-position=321 \ --stop-datetime="2019-06-28 12:00:00" \ /var/lib/mysql/mariadb-node4.00001 \ > mariadb-binlog.sql
Lastly, run the binary log SQL to restore the databases:
+$ mysql -u root -p < mariadb-binlog.sql
By default, available backups can be restored with full and complete backup restoration.
+Available as a feature forĀ Power TierĀ customers, point-in-time recovery (PITR) can be configured.
+When enabled, additional steps are taken to preserve binary logs, enabling point-in-time recovery to be used at a later date. Customers are responsible for additional storage costs.
+For Replicated Transactions service, when enabled, point-in-time recovery is available only to points after the last failover.
+Point-in-time recovery must be configured in advance of need to ensure the required data is available to support point-in-time recovery at a later date.
+Contact SkySQL SupportĀ to for point-in-time recovery configuration. This feature is available for Power Tier customers.
+ + + + + + + + + + + + + +Note
+COMING SOON - the new Backup service and the API documentation
+MariaDB SkySQL supports backup and restore:
+mariadb-dump
MariaDB SkySQL includes automated nightly backups:
+Single Node Transactions and Replicated Transactions services are backed up usingĀ MariaDB Enterprise Backup.
+MariaDB Enterprise Backup implements hot online backups by breaking up the backup process into multiple stages. During most stages, locking is minimal. The design allows writes and schema changes to occur during backups.
+ +By default, full and complete backup restoration is available. To enable point-in-time recovery, services must be configured in advance for additional binary log retention.Ā Point-in-time recovery (PITR)Ā configuration is available toĀ Power TierĀ customers.
+ + + + + + + + + + + + + +Billing is associated with aĀ MariaDB ID.
+For pricing information see "Pricing" .
+From theĀ Portal, you can access a current billing and usage summary:
+Current charges, prior billing date, and next invoice date are shown.
+Usage information can be shown by service or by resource.
+Click the resource name or service name to expand the view.
+ +Billing - Usage
+https://skysql.mariadb.com/billings/usage
+From theĀ Portal, you can access prior invoices:
+Billing - Billing History
+https://skysql.mariadb.com/billings/history
+ + + + + + + + + + + + + +Note
+COMING SOON ā¦ a complete feature checklist of both the tiers ... +A full description of billing and invoicing (FAQ covers a bit)
+Power Tier is a premium service offering who have the most critical requirements for uptime, availability, performance, and support.
+By default, any new signed up users are in the āFoundation Tierā. To upgrade to Power Tier,Ā simply click the āUpgradeā button - SkySQL support will contact you and start the upgrade process. You can also directly reach out to SkySQL Support.
+Features available to SkySQL Power Tier customers include:
+Database server configuration, including system variables, is managed through the Configuration Manager.
+ +Configuration Manager
+https://app.skysql.com/settings/configuration-manager
+To access the Configuration Manager interface:
+Available configuration parameters differ by cloud database topology.
+For cloud databases with the Enterprise Server Single Node topology, the following Configuration Manager parameters are used to configure MariaDB Enterprise Server behavior:
+Parameter
+disconnect_on_expired_password
+explicit_defaults_for_timestamp
+idle_readonly_transaction_timeout
+idle_write_transaction_timeout
+innodb_flush_log_at_trx_commit
+performance_schema_accounts_size
+performance_schema_digests_size
+performance_schema_events_stages_history_long_size
+performance_schema_events_stages_history_size
+performance_schema_events_statements_history_long_size
+performance_schema_events_statements_history_size
+performance_schema_events_waits_history_long_size
+performance_schema_events_waits_history_size
+performance_schema_max_cond_classes
+performance_schema_max_cond_instances
+performance_schema_max_digest_length
+performance_schema_max_file_classes
+performance_schema_max_file_handles
+performance_schema_max_file_instances
+performance_schema_max_mutex_classes
+performance_schema_max_mutex_instances
+performance_schema_max_rwlock_classes
+performance_schema_max_rwlock_instances
+performance_schema_max_socket_classes
+performance_schema_max_socket_instances
+performance_schema_max_stage_classes
+performance_schema_max_table_handles
+performance_schema_max_table_instances
+performance_schema_max_thread_classes
+performance_schema_max_thread_instances
+performance_schema_session_connect_attrs_size
+session_track_system_variables
+simple_password_check_letters_same_case
+simple_password_check_minimal_length
+simple_password_check_other_characters
+system_versioning_alter_history
+For cloud databases with the Enterprise Server With Replica(s) topology, Configuration Manager can be used to configure MariaDB Enterprise Server behavior and MariaDB MaxScale behavior.
+The following Configuration Manager parameters are used to configure MariaDB Enterprise Server behavior:
+Parameter
+disconnect_on_expired_password
+explicit_defaults_for_timestamp
+idle_readonly_transaction_timeout
+idle_write_transaction_timeout
+innodb_flush_log_at_trx_commit
+performance_schema_accounts_size
+performance_schema_digests_size
+performance_schema_events_stages_history_long_size
+performance_schema_events_stages_history_size
+performance_schema_events_statements_history_long_size
+performance_schema_events_statements_history_size
+performance_schema_events_waits_history_long_size
+performance_schema_events_waits_history_size
+performance_schema_max_cond_classes
+performance_schema_max_cond_instances
+performance_schema_max_digest_length
+performance_schema_max_file_classes
+performance_schema_max_file_handles
+performance_schema_max_file_instances
+performance_schema_max_mutex_classes
+performance_schema_max_mutex_instances
+performance_schema_max_rwlock_classes
+performance_schema_max_rwlock_instances
+performance_schema_max_socket_classes
+performance_schema_max_socket_instances
+performance_schema_max_stage_classes
+performance_schema_max_table_handles
+performance_schema_max_table_instances
+performance_schema_max_thread_classes
+performance_schema_max_thread_instances
+performance_schema_session_connect_attrs_size
+rpl_semi_sync_master_wait_no_slave
+rpl_semi_sync_master_wait_point
+rpl_semi_sync_slave_delay_master
+rpl_semi_sync_slave_kill_conn_timeout
+session_track_system_variables
+simple_password_check_letters_same_case
+simple_password_check_minimal_length
+simple_password_check_other_characters
+system_versioning_alter_history
+The following Configuration Manager parameters are used to configure MariaDB MaxScale behavior:
+Parameter
+transaction_replay_retry_on_deadlock
+MariaDB Connector/J enables Java applications to connect to MariaDB database products using a native MariaDB connector.
+Version | +Latest Release | +Latest Release Date | +Maturity | +
---|---|---|---|
MariaDB Connector/J 3.1 | +https://mariadb.com/docs/server/release-notes/mariadb-connector-j-3-1/3-1-4/ | +2023-05-01 | +General Availability | +
MariaDB Connector/J 3.0 | +https://mariadb.com/docs/server/release-notes/mariadb-connector-j-3-0/3-0-10/ | +2023-01-11 | +General Availability | +
MariaDB Connector/J 2.7 | +https://mariadb.com/docs/server/release-notes/mariadb-connector-j-2-7/2-7-9/ | +2023-03-22 | +General Availability | +
MariaDB Connector/J 1.8 | +MariaDB Connector/J 1.8.0 | +2019-02-11 | +GA | +
To download the JAR file manually:
+Maven can install MariaDB Connector/J as a dependency of your application during build. Set theĀ <version>
Ā element to correspond to the version of MariaDB Connector/J that you would like to install.
To use Maven to install MariaDB Connector/J, add the dependency to yourĀ pom.xml
Ā file:
<dependency>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>3.0.10</version>
+</dependency>
+
For additional information on available releases, see the "Release Notes for MariaDB Connector/J".
+Depending on the features you plan to use, you may need to add some additional dependencies toĀ pom.xml
.
If you downloaded the connector JAR, place it on your CLASSPATH
+export CLASSPATH="/path/to/application:/path/to/mariadb-java-client-3.0.10.jar"
+
In MariaDB Connector/J 3.0, TLS is enabled for connections to SkySQL using theĀ sslMode
Ā parameter.
import java.sql.*;
+import java.util.Properties;
+
+public class App {
+ public static void main(String[] argv) {
+ Properties connConfig = new Properties();
+ connConfig.setProperty("user", "db_user");
+ connConfig.setProperty("password", "db_user_password");
+ **connConfig.setProperty("sslMode", "verify-full");**
+ connConfig.setProperty("serverSslCert", "/path/to/skysql_chain.pem");
+
+ try (Connection conn = DriverManager.getConnection("jdbc:mariadb://HOST:PORT", connConfig)) {
+ try (Statement stmt = conn.createStatement()) {
+ try (ResultSet contact_list = stmt.executeQuery("SELECT first_name, last_name, email FROM test.contacts")) {
+ while (contact_list.next()) {
+ System.out.println(String.format("%s %s <%s>",
+ contact_list.getString("first_name"),
+ contact_list.getString("last_name"),
+ contact_list.getString("email")));
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
+
In MariaDB Connector/J 2.7 and before, TLS is enabled for connections to SkySQL using theĀ useSsl
Ā parameter.
import java.sql.*;
+import java.util.Properties;
+
+public class App {
+ public static void main(String[] argv) {
+ Properties connConfig = new Properties();
+ connConfig.setProperty("user", "db_user");
+ connConfig.setProperty("password", "db_user_password");
+ **connConfig.setProperty("useSsl", "true");**
+ connConfig.setProperty("serverSslCert", "/path/to/skysql_chain.pem");
+
+ try (Connection conn = DriverManager.getConnection("jdbc:mariadb://HOST:PORT", connConfig)) {
+ try (Statement stmt = conn.createStatement()) {
+ try (ResultSet contact_list = stmt.executeQuery("SELECT first_name, last_name, email FROM test.contacts")) {
+ while (contact_list.next()) {
+ System.out.println(String.format("%s %s <%s>",
+ contact_list.getString("first_name"),
+ contact_list.getString("last_name"),
+ contact_list.getString("email")));
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
+
Connector | +MariaDB Connector/J | +
---|---|
Supported Versions | +https://mariadb.com/docs/server/release-notes/mariadb-connector-j-3-1/https://mariadb.com/docs/server/release-notes/mariadb-connector-j-3-0/https://mariadb.com/docs/server/release-notes/mariadb-connector-j-2-7/MariaDB Connector/J 1.8 | +
Programming Language | +Java | +
Programming Language Version | +Java 17, Java 11, Java 8 (Connector/J 3.1)Java 17, Java 11, Java 8 (Connector/J 3.0)Java 17, Java 11, Java 8 (Connector/J 2.7)Java 7 (Connector/J 1.8) | +
API | +JDBC 4.2 (Connector/J 3.1)JDBC 4.2 (Connector/J 3.0)JDBC 4.2 (Connector/J 2.7)JDBC 4.1 (Connector/J 1.8) | +
Supports TLS | +Yes | +
License | +GNU Lesser General Public License v2.1 | +
The NoSQL protocol module allows a MariaDB server or cluster to execute transactions for applications using MongoDB client libraries, transparently converting MongoDB API calls into the equivalent SQL. The MariaDB responses are then converted into the format expected by the MongoDBĀ® client library and application.
+For detailed information on supported commands, see "NoSQL Protocol Module" in MariaDB MaxScale documentation.
+ + +Connect to the NoSQL interface using a MongoDB client library or compatible application.Ā Documentation on official MongoDB librariesĀ is available from MongoDB.
+Documentation on installingĀ mongosh
Ā (the MongoDB Shell)Ā is available from MongoDB.
From the Dashboard, the details needed to connect to your SkySQL service can be seen by clicking on the "CONNECT" button for the desired service.
+The "NoSQL port" is the TCP port used to connect to the NoSQL interface.
+TheĀ firewallĀ must be configured to allowlist the client's IP address or netblock before connections can occur.
+See the "Connecting using Mongosh" section of the Connect page for an exampleĀ mongosh
Ā command-line, authentication instructions, and instructions to change the default password.
Node.js developers can connect to MariaDB database products through a native MariaDB Connector. Using MariaDB Connector/Node.js you can connect to MariaDB database products to use and administer databases from within your Node.js application.
+MariaDB Connector/Node.js is usually installed either from the Node.js repository or manually from the source code package.
+To install MariaDB Connector/Node.js from the Node.js repository, use NPM:
+$ npm install mariadb
NPM connects to the Node.js repository and downloads MariaDB Connector/Node.js and all relevant dependencies into theĀ node_modules/
Ā directory.
To download and install the MariaDB Connector/Node.js manually from source code:
+When the source code package finishes downloading, install it with NPM:
+$ npm install mariadb-connector-nodejs-*.tar.gz
NPM untars the download and installs MariaDB Connector/Node.js in theĀ node_modules/
Ā directory.
Node.js developers can use MariaDB Connector/Node.js to establish client connections with MariaDB database products.
+MariaDB Connector/Node.js provides two different connection implementations: one built on theĀ Promise APIĀ and the other built on the Callback API.
+To use the Callback API, use the following module:
+**const** mariadb = require**(**'mariadb/callback'**);**
createConnection(options)Ā ->Ā Connection
Ā is the base function used to create aĀ Connection
Ā object.
TheĀ createConnection(options)
Ā function returns aĀ Connection
Ā object.
Determine theĀ connection informationĀ for your MariaDB SkySQL database service:
+Option | +Description | +
---|---|
host | +The fully Qualified Domain Name in theĀ https://mariadb.com/docs/skysql-previous-release/connect/connection-parameters-portal/ | +
port | +The Read-Write Port or Read-Only Port in theĀ https://mariadb.com/docs/skysql-previous-release/connect/connection-parameters-portal/ | +
user | +The desired username, which might be the default username in the Service Credentials view | +
password | +The user's password, which might be the default password in the Service Credentials view if it was not yet customized | +
database | +Database name to establish a connection to. No default is configured. | +
connectTimeout | +Connection timeout in milliseconds. In Connector/Node.js 2.5.6, the default value changed to 1000. The default value for earlier versions is 10000. | +
rowsAsArray | +A boolean value to indicate whether to return result sets as array instead of the default JSON. Arrays are comparatively faster. | +
The following code example connects using the database and user account created in theĀ example setup:
+const mariadb = require('mariadb/callback');
+
+// Certificate Authority (CA)",
+var serverCert = [fs.readFileSync(process.env.SKYSQL_CA_PEM, "utf8")];
+
+// Declare async function
+function main() {
+ let conn;
+
+ try {
+ conn = mariadb.createConnection({
+ host: "example.skysql.net",
+ port: 5009,
+ ssl: { ca: serverCert },
+ user: "db_user",
+ password: "db_user_password",
+ database: "test",
+ });
+
+ // Use Connection
+ // ...
+ } catch (err) {
+ // Manage Errors
+ console.log("SQL error in establishing a connection: ", err);
+ } finally {
+ // Close Connection
+ if (conn) conn.end(err => {if(err){
+ console.log("SQL error in closing a connection: ", err);}
+ });
+ }
+}
+
+main();
+
try...catch...finally
Ā statement is used for exception handling.connection.end([callback])
Ā function.connection.end([callback])
Ā function to close/end the connection in theĀ finally
Ā block after the queries that are running have completed.end()
Ā function takes a callback function that defines one implicit argument for theĀ Error
Ā object if thrown in closing the connection as argument. If no error is generated in closing a connection theĀ Error
Ā object isĀ null
.Node.js developers can use MariaDB Connector/Node.js to establish client connections with MariaDB database products.
+MariaDB Connector/Node.js provides two different connection implementations: one built on the Promise API and the other built on theĀ Callback API. Promise is the default.
+To use the Promise API, use theĀ mariadb
Ā module:
**const** mariadb = require**(**'mariadb'**);**
createConnection(options)Ā ->Ā Promise
Ā is the base function used to create aĀ Connection
Ā object.
TheĀ createConnection(options)
Ā returns aĀ Promise
Ā that resolves to aĀ Connection
Ā object if no error occurs, and rejects with anĀ Error
Ā object if an error occurs.
Determine theĀ connection informationĀ for your MariaDB SkySQL database service:
+Option | +Description | +
---|---|
host | +The fully Qualified Domain Name in theĀ https://mariadb.com/docs/skysql-previous-release/connect/connection-parameters-portal/ | +
port | +The Read-Write Port or Read-Only Port in theĀ https://mariadb.com/docs/skysql-previous-release/connect/connection-parameters-portal/ | +
user | +The desired username, which might be the default username in the Service Credentials view | +
password | +The user's password, which might be the default password in the Service Credentials view if it was not yet customized | +
ssl.ca | +The contents of theĀ skysql_chain.pemĀ file containing theĀ https://mariadb.com/docs/skysql-previous-release/connect/connection-parameters-portal/#Certificate_Authority_Chain | +
ā¢ https://supplychain.mariadb.com/skysql_chain.pem | ++ |
ā¢ https://supplychain.mariadb.com/aws_skysql_chain.pem | ++ |
database | +Database name to establish a connection to. No default is configured. | +
connectTimeout | +Connection timeout in milliseconds. In Connector/Node.js 2.5.6, the default value changed to 1000. The default value for earlier versions is 10000. | +
rowsAsArray | +A boolean value to indicate whether to return result sets as array instead of the default JSON. Arrays are comparatively faster. | +
Create a file namedĀ .env
Ā to store your database credentials:
MDB_HOST = 192.0.2.50
+MDB_PORT = 3306
+MDB_USER = db_user
+MDB_PASS = db_user_password
+MDB_HOST = example.skysql.net
+MDB_PORT = 5001
+MDB_CA_PEM = /path/to/skysql_chain.pem
+MDB_USER = db_user
+MDB_PASS = db_user_password
+
The following code example connectsĀ using the database and user account created inĀ Setup for Examples:
+// Required Modules
+const fs = require("fs");
+const mariadb = require("mariadb");
+require("dotenv").config()
+
+// Certificate Authority (CA)
+const serverCert = [fs.readFileSync(process.env.MDB_CA_PEM, "utf8")];
+
+// Declare async function
+async function main() {
+ let conn;
+
+ try {
+ conn = await mariadb.createConnection({
+ host: process.env.MDB_HOST,
+ port: process.env.MDB_PORT,
+ user: process.env.MDB_USER,
+ password: process.env.MDB_PASS,
+ ssl: { ca: serverCert },
+ database: "test",
+ });
+
+ // Use Connection
+ // ...
+ } catch (err) {
+ // Manage Errors
+ console.log("SQL error in establishing a connection: ", err);
+ } finally {
+ // Close Connection
+ if (conn) conn.close();
+ }
+}
+
+main();
+
mariadb
Ā module using theĀ require()
Ā function.main()
Ā using theĀ async
Ā keyword.await
Ā expressions using theĀ await
Ā keyword.await
Ā expression is the resolved value of theĀ Promise
.main
Ā is arbitrary and does not have special meaning as in some other programming languages.conn
Ā for the connection to be created using aĀ let
Ā statement with the async functionĀ main
.try...catch...finally
Ā statement is used for exception handling.try
Ā block, create a new connection using theĀ mariadb#createConnection(options)
Ā function in the Promise API.catch
Ā block.close()
Ā function.Connector | +MariaDB Connector/Node.js | +
---|---|
Supported Versions | +https://mariadb.com/docs/server/release-notes/mariadb-connector-nodejs-2-5/https://mariadb.com/docs/server/release-notes/mariadb-connector-nodejs-3-2/ | +
Programming Language | +JavaScript | +
Programming Language Version | +ā¢ Connector/Node.js 2.5: Node.js 16 | +
ā¢ Connector/Node.js 3.2: Node.js 16, 18, 20 | ++ |
API | +Promise APICallback API | +
Supports TLS | +Yes | +
Supports Connection Pools | +Yes | +
License | +GNU Lesser General Public License v2.1 | +
Python developers can use MariaDB Connector/Python to establish client connections with SkySQL database products.
+Connections are managed using the following Python class:
+Class | +Description | +
---|---|
Connection | +Represents a connection to a MariaDB database product. | +
Connections are created, used, and managed using the following Connection
class functions:
Function | +Description | +
---|---|
connect() | +Establishes a connection to a database server and returns a | +
connection object. | ++ |
cursor() | +Returns a new cursor object for the current connection. | +
change_user() | +Changes the user and default database of the current | +
connection. | ++ |
reconnect() | +Tries to make a connection object active again by reconnecting to | +
the server using the same credentials which were specified in connect() | ++ |
method. | ++ |
close() | +Closes the connection. | +
Determine the connection information for your SkySQL database service:
+| connect() +parameter | Where to find it | +| --- | --- | +| user | Default username in the Service Credentials view, or the username +you created | +| passwd | Default password in the Service Credentials view, the password +you set on the default user, or the password for the user you +created | +| host | Fully Qualified Domain Name in the https://www.notion.so../../../connection-parameters-portal/ | +| ssl_verify_cert | Set to True to support SSL | +| port | Read-Write Port or Read-Only Port in the https://www.notion.so../../../connection-parameters-portal/ |
+The following code example connects to an example server.
+Examples:
+# Module Import
+import mariadb
+import sys
+
+# Instantiate Connection
+try:
+ conn = mariadb.connect(
+ host="192.0.2.1",
+ port=3306,
+ user="db_user",
+ password="USER_PASSWORD")
+except mariadb.Error as e:
+ print(f"Error connecting to the database: {e}")
+ sys.exit(1)
+
+# Use Connection
+# ...
+
+# Close Connection
+conn.close()
+
# Module Import
+import mariadb
+import sys
+
+# Instantiate Connection
+try:
+ conn = mariadb.connect(
+ host="SKYSQL_SERVICE.mdb0000001.db.skysql.com",
+ port=5009,
+ ssl_verify_cert=True,
+ user="DB00000001",
+ password="USER_PASSWORD")
+except mariadb.Error as e:
+ print(f"Error connecting to the database: {e}")
+ sys.exit(1)
+
+# Use Connection
+# ...
+
+# Close Connection
+conn.close()
+
connect()
function returns an instance of the Connection
class, which is assigned to the conn
variable.connect()
function.close()
method.Instantiating the Connection
class creates a single connection to MariaDB database products. Applications that require multiple connections may benefit from pooling connections.
MariaDB Connector/Python closes the connection as part of the class's destructor, which is executed when an instance of the class goes out of scope. This can happen in many cases, such as:
+Connection
class is defined in the local scope of a function, and the function returnsConnection
class is defined as an attribute of a custom class's instance, and the custom class's instance goes out of scope.Connections can also be explicitly closed using the close()
method, which is helpful when the connection is no longer needed, but the variable is still in scope.
Starting with MariaDB Connector/Python 1.1 when MariaDB Connector/Python is built with MariaDB Connector/C 3.3, the connector supports connection failover when auto_reconnect
is
+enabled and the connection string contains a comma-separated list of multiple server addresses.
To enable connection failover:
+mariadb.connect
function with the host
argument specified as a comma-separated list containing multiple server addresses. The connector attempts to connect to the addresses in the order specified in the list.auto_reconnect
to True
. If the connection fails, the connector will attempt to reconnect to the addresses in the order specified in the list.The following code example connects with connection failover enabled:
+# Module Import
+import mariadb
+import sys
+
+# Instantiate Connection
+try:
+ conn = mariadb.connect(
+ host="192.0.2.1,192.0.2.0,198.51.100.0",
+ port=3306,
+ user="db_user",
+ password="USER_PASSWORD")
+ conn.auto_reconnect = True
+except mariadb.Error as e:
+ print(f"Error connecting to the database: {e}")
+ sys.exit(1)
+
+# Use Connection
+# ...
+
+# Close Connection
+conn.close()
+
# Module Import
+import mariadb
+import sys
+
+# Instantiate Connection
+try:
+ conn = mariadb.connect(
+ host="SKYSQL_SERVICE.mdb0000001.db.skysql.com,SKYSQL_SERVICE.mdb0000002.db.skysql.com",
+ port=5009,
+ ssl_verify_cert=True,
+ user="DB00000001",
+ password="USER_PASSWORD")
+ conn.auto_reconnect = True
+except mariadb.Error as e:
+ print(f"Error connecting to the database: {e}")
+ sys.exit(1)
+
+# Use Connection
+# ...
+
+# Close Connection
+conn.close()
+
MariaDB Connector/C++ enables C++ applications to establish client connections to MariaDB database over TLS.
+MariaDB Connector/C++ has dependencies. You must install MariaDB Connector/C to use it.
+MariaDB Connector/C++ | +MariaDB Connector/C | +
---|---|
1.1 | +3.2.3 or later | +
1.0 | +3.1.1 or later | +
For additional information, see "MariaDB Connector/C++ Release Notes".
+To install MariaDB Connector/C++ on Linux:
+Extract the tarball:
+$ tar -xvzf mariadb-connector-cpp-*.tar.gz
Change into the relevant directory:
+$ cd mariadb-connector-cpp-*/
Install the directories for the header files:
+$ sudo install -d /usr/include/mariadb/conncpp
+$ sudo install -d /usr/include/mariadb/conncpp/compat
Install the header files:
+$ sudo install include/mariadb/* /usr/include/mariadb/
+$ sudo install include/mariadb/conncpp/* /usr/include/mariadb/conncpp
+$ sudo install include/mariadb/conncpp/compat/* /usr/include/mariadb/conncpp/compat
Install the directories for the shared libraries:
+On CentOS, RHEL, Rocky Linux:
+$ sudo install -d /usr/lib64/mariadb
+$ sudo install -d /usr/lib64/mariadb/plugin
On Debian, Ubuntu:
+$ sudo install -d /usr/lib/mariadb
+$ sudo install -d /usr/lib/mariadb/plugin
Install the shared libraries:
+On CentOS, RHEL, Rocky Linux:
+$ sudo install lib64/mariadb/libmariadbcpp.so /usr/lib64
+$ sudo install lib64/mariadb/plugin/* /usr/lib64/mariadb/plugin
On Debian, Ubuntu:
+$ sudo install lib/mariadb/libmariadbcpp.so /usr/lib
+$ sudo install lib/mariadb/plugin/* /usr/lib/mariadb/plugin
To install MariaDB Connector/C++ on Windows:
+mariadbcpp
Ā LIB
Ā file (exampleĀ "C:\ProgramĀ Files\MariaDB\MariaDBĀ C++Ā ConnectorĀ 64-bit"
) toĀ PATH
Ā environment variable.Version | +Latest Release | +Latest Release Date | +Maturity | +
---|---|---|---|
MariaDB Connector/C++ 1.1 | +https://mariadb.com/docs/server/release-notes/mariadb-connector-cpp-1-1/1-1-2/ | +2022-11-30 | +Release Candidate | +
MariaDB Connector/C++ 1.0 | +https://mariadb.com/docs/server/release-notes/mariadb-connector-cpp-1-0/1-0-2/ | +2022-10-11 | +General Availability | +
The connection is configured via the information that is initially acquired from the SkySQL Portal pages:
+What to set | +Where to find it | +
---|---|
Hostname in the URL | +The fully Qualified Domain Name in theĀ https://mariadb.com/docs/skysql-previous-release/connect/connection-parameters-portal/ | +
Port number in the URL | +The Read-Write Port or Read-Only Port in theĀ https://mariadb.com/docs/skysql-previous-release/connect/connection-parameters-portal/ | +
userĀ parameter | +The desired username, which might be the default username in the Service Credentials view | +
passwordĀ parameter | +The user's password, which might be the default password in the Service Credentials view if it was not yet customized | +
tlsCertĀ parameter | +The path to theĀ skysql_chain.pemĀ file containing theĀ https://mariadb.com/docs/skysql-previous-release/connect/connection-parameters-portal/#Certificate_Authority_Chain | +
ā¢ https://supplychain.mariadb.com/skysql_chain.pem | ++ |
ā¢ https://supplychain.mariadb.com/aws_skysql_chain.pem | ++ |
While MariaDB Connector/C++ supports several connection styles, we are going to detail just the JDBC syntax since all connections to SkySQL use a single idiom of hostname, port, user, password, and SSL parameters.
+The base URL is specified as follows:
+jdbc:mariadb://example.skysql.net:5001/dbname
If the trailing database name is left off of the URL, the connection will start without selecting a database.
+MariaDB Connector/C++ supports several optional connection parameters. These parameters can be specified using aĀ Properties
Ā object, as we do in our examples, or appended to the URL in standardĀ name=value
Ā query-string encoding.
In the following list, we've left out any parameters that aren't pertinent to accessing SkySQL:
+Parameter Name | +Description | +Type | +Default | +Aliases | +
---|---|---|---|---|
autoReconnect | +Defines whether the connector automatically reconnects after a connection failure. | +bool | +false | +ā¢ OPT_RECONNECT | +
connectTimeout | +Defines the connect timeout value in milliseconds. When set toĀ 0, there is no connect timeout. | +int | +30000 | ++ |
enabledTlsCipherSuites | +A list of permitted ciphers or cipher suites to use for TLS. | +string | ++ | ā¢ enabledSslCipherSuites | +
ā¢ enabledSSLCipherSuites | ++ | + | + | + |
jdbcCompliantTruncation | +This mode is enabled by default. This mode configures the connector to addĀ STRICT_TRANS_TABLESĀ toĀ https://mariadb.com/docs/server/ref/mdb/system-variables/sql_mode/https://mariadb.com/docs/server/ref/mdb/system-variables/sql_mode/, which causes ES to handle truncation issues as errors instead of warnings. | +bool | +true | ++ |
password | +Defines the password of the user account to connect with. | ++ | + | + |
socketTimeout | +Defines the network socket timeout (SO_TIMEOUT) in milliseconds. When set toĀ 0, there is no socket timeout. This connection parameter is not intended to set a maximum time for statements. To set a maximum time for statements, please see theĀ https://mariadb.com/docs/server/ref/mdb/system-variables/max_statement_time/https://mariadb.com/docs/server/ref/mdb/system-variables/max_statement_time/https://mariadb.com/docs/server/ref/mdb/system-variables/max_statement_time/Ā system variable. | +int | +0 | +ā¢ OPT_READ_TIMEOUT | +
tcpRcvBuf | +The buffer size for TCP/IP and socket communication.Ā tcpSndBufĀ changes the same buffer value, and the biggest value of the two is selected. | +int | +0x4000 | +ā¢ tcpSndBuf | +
tcpSndBuf | +The buffer size for TCP/IP and socket communication.Ā tcpRcvBufĀ changes the same buffer value, and the biggest value of the two is selected. | +int | +0x4000 | +ā¢ tcpRcvBuf | +
tlsCert | +Path to the X509 certificate file. | +string | ++ | ā¢ sslCert | +
tlsCRL | +Path to a PEM file that should contain one or more revoked X509 certificates. | +string | ++ | ā¢ tlsCrl | +
ā¢ sslCRL | ++ | + | + | + |
useCompression | +Compresses network traffic between the client and server. | +bool | +false | +ā¢ CLIENT_COMPRESS | +
user | +Defines the user name of the user account to connect with. | ++ | + | ā¢ userName | +
useServerPrepStmts | +Defines whether the connector uses server-side prepared statements using theĀ https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/PREPARE/,Ā https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/EXECUTE/, andĀ https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/DROP_PREPARE/Ā statements. By default, the connector uses client-side prepared statements. | +bool | +false | ++ |
useTls | +Whether to force TLS. This enables TLS with the default system settings. | +bool | ++ | ā¢ useSsl | +
ā¢ useSSL | ++ | + | + | + |
Two categories of methods are available to to establish a connection.
+MariaDB Connector/C++ can connect using the non-staticĀ connect()
Ā methods in theĀ sql::Driver
Ā class.
The non-staticĀ connect()
Ā methods in theĀ sql::Driver
Ā class have the following prototypes:
Connection*Ā connect(constĀ SQLString&Ā url,Ā Properties&Ā props);
Connection*Ā connect(constĀ SQLString&Ā host,Ā constĀ SQLString&Ā user,Ā constĀ SQLString&Ā pwd);
Connection*Ā connect(constĀ Properties&Ā props);
The non-staticĀ connect()
Ā methods in theĀ sql::Driver
Ā class:
sql::Driver
Ā class to establish a connection.nullptr
Ā as theĀ Connection*
Ā value when an error occurs, so applications should check the return value before use.For example:
+// Instantiate Driver
+sql::Driver* driver = sql::mariadb::get_driver_instance();
+
+// Configure Connection, including an optional initial database name "places":
+sql::SQLString url("jdbc:mariadb://example.skysql.net:5009/places");
+
+// Use a properties map for the other connection options
+sql::Properties properties({
+ {"user", "db_user"},
+ {"password", "db_user_password"},
+ {"autocommit", false},
+ {"useTls", true},
+ {"tlsCert", "classpath:static/skysql_chain.pem"},
+ });
+
+// Establish Connection
+// Use a smart pointer for extra safety
+std::unique_ptr<sql::Connection> conn(driver->connect(url, properties));
+
+if (!conn) {
+ cerr << "Invalid database connection" << endl;
+ exit (EXIT_FAILURE);
+}
+
MariaDB Connector/C++ can connect using the staticĀ getConnection()
Ā methods in theĀ sql::DriverManager
Ā class.
The staticĀ getConnection()
Ā methods in theĀ sql::DriverManager
Ā class have the following prototypes:
staticĀ Connection*Ā getConnection(constĀ SQLString&Ā url);
staticĀ Connection*Ā getConnection(constĀ SQLString&Ā url,Ā Properties&Ā props);
staticĀ Connection*Ā getConnection(constĀ SQLString&Ā url,Ā constĀ SQLString&Ā user,Ā constĀ SQLString&Ā pwd);
The staticĀ getConnection()
Ā methods in theĀ sql::DriverManager
Ā class:
sql::DriverManager
Ā class to establish a connection, because they are static.tryĀ {Ā ..Ā }Ā catchĀ (Ā ..Ā )Ā {Ā ..Ā }
Ā to catch the exception.For example:
+try {
+ // Configure Connection, including an optional initial database name "places":
+ sql::SQLString url("jdbc:mariadb://example.skysql.net:5009/places");
+
+ // Use a properties map for the other connection options
+ sql::Properties properties({
+ {"user", "db_user"},
+ {"password", "db_user_password"},
+ {"autocommit", false},
+ {"useTls", true},
+ {"tlsCert", "classpath:static/skysql_chain.pem"},
+ });
+
+ // Establish Connection
+ // Use a smart pointer for extra safety
+ std::unique_ptr<sql::Connection> conn(DriverManager::getConnection(url, properties));
+ } catch (...) {
+ cerr << "Invalid database connection" << endl;
+ exit (EXIT_FAILURE);
+}
+
The following code demonstrates how to connect using theĀ example database and user account:
+// Includes
+#include <iostream>
+#include <mariadb/conncpp.hpp>
+
+// Main Process
+int main(int argc, char **argv)
+{
+ try {
+ // Instantiate Driver
+ sql::Driver* driver = sql::mariadb::get_driver_instance();
+
+ // Configure Connection, including initial database name "test":
+ sql::SQLString url("jdbc:mariadb://example.skysql.net:5009/test");
+
+ // Use a properties map for the other connection options
+ sql::Properties properties({
+ {"user", "db_user"},
+ {"password", "db_user_password"},
+ {"autocommit", false},
+ {"useTls", true},
+ {"tlsCert", "classpath:static/skysql_chain.pem"},
+ });
+
+ // Establish Connection
+ // Use a smart pointer for extra safety
+ std::unique_ptr<sql::Connection> conn(driver->connect(url, properties));
+
+ // Use Connection
+ // ...
+
+ // Close Connection
+ conn->close();
+ }
+
+ // Catch Exceptions
+ catch (sql::SQLException& e) {
+ std::cerr << "Error Connecting to the database: "
+ << e.what() << std::endl;
+
+ // Exit (Failed)
+ return 1;
+ }
+
+ // Exit (Success)
+ return 0;
+}
+
MariaDB Connector/C enables C and C++ applications to establish client connections to MariaDB database products over TLS. MariaDB Connector/C is a native connector that is written in C.
+MariaDB Connector/C is compatible with:
+MariaDB Connector/C enables C and C++ applications to establish client connections to MariaDB database products over TLS.
+Additional information on MariaDB Connector/C is available in theĀ MariaDB Knowledge Base.
+The connection is configured via the information that is initially acquired from the SkySQL Portal pages:
+Function | +Option/Argument | +Where to find it | +
---|---|---|
mysql_optionsv() | +MYSQL_OPT_SSL_CAĀ option | +The path to theĀ skysql_chain.pemĀ file containing theĀ https://mariadb.com/docs/skysql-previous-release/connect/connection-parameters-portal/#Certificate_Authority_Chain | +
ā¢ https://supplychain.mariadb.com/skysql_chain.pem | ++ | + |
ā¢ https://supplychain.mariadb.com/aws_skysql_chain.pem | ++ | + |
mysql_real_connect() | +hostĀ argument | +The fully Qualified Domain Name in theĀ https://mariadb.com/docs/skysql-previous-release/connect/connection-parameters-portal/ | +
mysql_real_connect() | +userĀ argument | +The desired username, which might be the default username in the Service Credentials view | +
mysql_real_connect() | +passwdĀ argument | +The user's password, which might be the default password in the Service Credentials view if it was not yet customized | +
mysql_real_connect() | +portĀ argument | +The Read-Write Port or Read-Only Port in theĀ https://mariadb.com/docs/skysql-previous-release/connect/connection-parameters-portal/ | +
The following code demonstrates how to use MariaDB Connector/C to connect to MariaDB database products. This example uses theĀ example database and user account:
+#include <stdio.h>
+#include <stdlib.h>
+#include <mysql.h>
+
+int main (int argc, char* argv[])
+{
+
+ // Initialize Connection
+ MYSQL *conn;
+ if (!(conn = mysql_init(0)))
+ {
+ fprintf(stderr, "unable to initialize connection struct\n");
+ exit(1);
+ }
+
+ char* cafile = "/path/to/skysql_chain.pem";
+
+ // Configure the TLS Certificate Authority. This may vary by hosting provider!
+ mysql_optionsv(conn, MYSQL_OPT_SSL_CA, cafile);
+
+ // Connect to the database
+ if (!mysql_real_connect(
+ conn, // Connection
+ "example.skysql.net", // Host
+ "db_user", // User account
+ "db_user_password", // User password
+ "test", // Default database
+ 3006, // Port number
+ NULL, // Path to socket file
+ 0 // Additional options
+ ))
+ {
+ // Report the failed-connection error & close the handle
+ fprintf(stderr, "Error connecting to Server: %s\n", mysql_error(conn));
+ mysql_close(conn);
+ exit(1);
+ }
+
+ // Use the Connection
+ // ...
+
+ // Close the Connection
+ mysql_close(conn);
+
+ return 0;
+}
+
Java developers can use MariaDB Connector/R2DBC to connect to MariaDB database products using the Reactive Relational Database Connectivity (R2DBC) API. R2DBC operations are non-blocking, which makes the R2DBC API more scalable than Java's standard JDBC API. MariaDB Connector/R2DBC is available both with a native R2DBC implementation and the Spring Data R2DBC framework.
+Connector | +MariaDB Connector/R2DBC | +MariaDB Connector/R2DBC | +
---|---|---|
Supported Versions | +1.0 | +1.1 | +
Programming Language | +Java | +Java | +
Programming Language Version | +Java 8+ | +Java 8+ | +
API | +https://r2dbc.io/spec/0.8.5.RELEASE/spec/html/ | +https://r2dbc.io/spec/1.0.0.RELEASE/spec/html | +
Supports TLS | +Yes | +Yes | +
Supports Connection Pools | +Yes | +Yes | +
License | +Apache 2.0 | +Apache 2.0 | +
For details on how to use MariaDB Connector/R2DBC, choose a supported framework:
+https://mariadb.com/docs/skysql-previous-release/connect/programming-languages/java-r2dbc/native/ | +The native implementation of R2DBC can be used to connect using MariaDB Connector/R2DBC from within your Java application. | +
---|---|
https://mariadb.com/docs/skysql-previous-release/connect/programming-languages/java-r2dbc/spring/ | +Spring Data implementation of R2DBC allows you to connect using MariaDB Connector/R2DBC using the Spring Framework. | +
Application developers can use MariaDB Connector/ODBC to establish a data source for client connections with MariaDB database products.
+The method for configuring the data source varies between operating systems.
+Configure unixODBC
to recognize the driver by creating a file called MariaDB_odbc_driver_template.ini
with the relevant driver definition.
For example, on CentOS / RHEL / Rocky Linux:
+[MariaDB ODBC 3.1 Driver]
+Description = MariaDB Connector/ODBC v.3.1
+Driver = /usr/lib64/libmaodbc.so
+
On Debian / Ubuntu:
+[MariaDB ODBC 3.1 Driver]
+Description = MariaDB Connector/ODBC v.3.1
+Driver = /usr/lib/libmaodbc.so
+
Install the driver using the odbcinst
command.
For example:
+$ sudo odbcinst -i -d -f MariaDB_odbc_driver_template.ini
+odbcinst: Driver installed. Usage count increased to 1.
+Target directory is /etc
+
Determine the connection parameters for your database.
+Configure unixODBC
to connect to the data source by creating a file called MariaDB_odbc_data_source_template.ini
with the relevant data source parameters.
For example:
+# Data Source for unixODBC
+[My-Test-Server]
+Description = Describe your database setup here
+Driver = MariaDB ODBC 3.1 Driver
+Trace = Yes
+TraceFile = /tmp/trace.log
+SERVER = localhost
+SOCKET = /var/run/mysqld/mysqld.sock
+USER = db_user
+PASSWORD = db_user_password
+DATABASE = test
+
# Data Source for unixODBC
+[My-Test-Server]
+Description = Describe your database setup here
+Driver = MariaDB ODBC 3.1 Driver
+Trace = Yes
+TraceFile = /tmp/trace.log
+SERVER = example.skysql.com
+PORT = 3306
+SSLVERIFY = 1
+USER = db_user
+PASSWORD = db_user_password
+DATABASE = test
+
unixODBC
data source template file:$ sudo odbcinst -i -s -h -f MariaDB_odbc_data_source_template.ini
+
Test the data source My-Test-Server
configured in the MariaDB_odbc_data_source_template.ini
+file using the isql
command:
$ isql My-Test-Server
++-------------------------+
+| Connected! |
+| sql-statement |
+| help[tablename] |
+| quit |
++-------------------------+
+SQL>
+
To select your new data source in your application, select the data source with the name that you configured, which is My-Test-Server
in the above example.
Confirm that MariaDB Connector/ODBC has been registered withiODBC
by confirming that the following options are set in the iODBC
configuration file at /Library/ODBC/odbcinst.ini
:
[ODBC]
+Trace = no
+TraceFile = /tmp/iodbc_trace.log
+
+[ODBC Drivers]
+MariaDB ODBC 3.1 Unicode Driver = Installed
+
+[MariaDB ODBC 3.1 Unicode Driver]
+Driver = /Library/MariaDB/MariaDB-Connector-ODBC/libmaodbc.dylib
+Description = MariaDB Connector/ODBC(Unicode) 3.1 64bit
+Threading = 0
+
Determine the connection parameters for your database.
+Add a data source for your database to iODBC
by adding the following options to the iODBC
configuration file at /Library/ODBC/odbc.ini
:
[ODBC Data Sources]
+My-Test-Server = MariaDB ODBC 3.1 Unicode Driver
+
+[My-Test-Server]
+Driver = /Library/MariaDB/MariaDB-Connector-ODBC/libmaodbc.dylib
+SERVER = 192.0.2.1
+DATABASE = test
+USER = db_user
+PASSWORD = db_user_password
+
SERVER
, SOCKET
, DATABASE
, PORT
, USER
, and PASSWORD
parameters with the relevant value for your environment.iodbctest
command:$ iodbctest "DSN=My-Test-Server"
+
To select your new data source in your application, select the data source with the name that you configured, which is My-Test-Server
in the above example.
MariaDB Connector/ODBC requires at least Windows 8.
+Windows 10 was used to prepare these instructions. When using other versions of Windows, these instructions may require adjustment.
+MariaDB Connector/ODBC supports failover in case one or more hosts are not available.
+The failover feature requires using MariaDB Connector/ODBC 3.1.16 or greater with MariaDB Connector/C 3.3 or greater.
+MariaDB Connector/ODBC 3.1.16 and greater is statically linked for Windows and macOS with MariaDB Connector/C 3.3.1. MariaDB Connector/ODBC 3.1.16 and greater is dynamically linked for Linux with MariaDB Connector/C.
+The failover feature is enabled by providing a comma separated list of hosts as a server name.
+The failover host string is the SERVER
string. If the SERVER
string does not include a port, the default port will be used.
The following syntax is required:
+"[]"
":"
hostname:port
pairs must be be separated by a comma ","
hostname:port
is specified, the host string must end with a commaAn example of a failover host string:
+[::1]:3306,192.168.0.1:3307,test.example.com
Connection Parameter | +Description | +Default Value | +
---|---|---|
DRIVER | +ā¢ On Linux, the name of the driver, which is configured in the | ++ |
unixODBC driver template file. | ++ | + |
ā¢ On macOS, the path to the driver's shared library, which is | ++ | + |
installed at /Library/MariaDB/MariaDB-Connector-ODBC/libmaodbc.dylib | ++ | + |
by default. | ++ | + |
SERVER | +Host name, IPv4 address, or IPv6 address of the database | ++ |
server. | +localhost | ++ |
SOCKET | +ā¢ The path to the socket file. On Linux, MariaDB Enterprise Server | ++ |
uses different default socket files on different Linux | ++ | + |
distributions. | ++ | + |
ā¢ On Debian / Ubuntu, the default socket file is /var/run/mysqld/mysqld.sock | ++ | + |
or /run/mysqld/mysqld.sock. | ++ | + |
ā¢ On CentOS / RHEL / Rocky Linux, the default socket file is /var/lib/mysql/mysql.sock. | +/tmp/mysql.sock | ++ |
DATABASE | +Database name to select upon successful connection. The database | ++ |
must already exist, and the user account must have privileges to select | ++ | + |
it. | ++ | + |
PORT | +TCP port of the database server. | +3306 | +
USER | +The username to use for authentication. | ++ |
PASSWORD | +User password. | ++ |
FORWARDONLY | +When enabled, cursors are created as SQL_CURSOR_FORWARD_ONLY, | ++ |
so they can only move forward. Starting in Connector/ODBC 3.2, cursors | ++ | + |
are SQL_CURSOR_FORWARD_ONLY | ++ | + |
by default. In previous releases, cursors are created as SQL_CURSOR_STATIC by | ++ | + |
default. | ++ | + |
NO_CACHE | +When enabled, result set streaming is enabled, which enables the | ++ |
application to fetch result sets from the server row-by-row instead of | ++ | + |
caching the entire result set on the client side. Since the application | ++ | + |
is not caching the entire result set, the application is less likely to | ++ | + |
run out of memory when working with large result sets. | ++ | + |
STREAMRS | +Alias for the NO_CACHE connection | ++ |
parameter. | ++ | + |
OPTIONS | +See about:blank#OPTIONS_Bitmaskabout:blank#OPTIONS_Bitmask. | ++ |
PREPONCLIENT | +When enabled, the SQLPrepare ODBC API | ++ |
function uses the text protocol and client-side prepared statements | ++ | + |
(CSPS). | ++ | + |
ATTR | +Sets connection attributes that can be queried via the https://www.notion.so../../../../ref/mdb/performance-schema/session_account_connect_attrs/https://www.notion.so../../../../../server/ref/mdb/performance-schema/session_account_connect_attrs/ | ++ |
and https://www.notion.so../../../../ref/mdb/performance-schema/session_connect_attrs/https://www.notion.so../../../../../server/ref/mdb/performance-schema/session_connect_attrs/ | ++ | + |
tables when https://www.notion.so../../../../ref/mdb/system-variables/performance_schema/https://www.notion.so../../../../../server/ref/mdb/system-variables/performance_schema/ | ++ | + |
is enabled. Specify attributes in the format ATTR={ |
++ | + |
What | +Where to find it | +
---|---|
DRIVER | +ā¢ On Linux, the name of the driver, which is configured in the | +
unixODBC driver template file. | ++ |
ā¢ On macOS, the path to the driver's shared library, which is | ++ |
installed at /Library/MariaDB/MariaDB-Connector-ODBC/libmaodbc.dylib | ++ |
by default. | ++ |
SERVER | +Fully Qualified Domain Name in the https://www.notion.so../../../connection-parameters-portal/ | +
PORT | +Read-Write Port or Read-Only Port in the https://www.notion.so../../../connection-parameters-portal/ | +
USER | +Default username in the Service Credentials view, or the username | +
you created | ++ |
PASSWORD | +Default password in the Service Credentials view, the password | +
you set on the default user, or the password for the user you | ++ |
created | ++ |
SSLVERIFY | +Set to 1 to connect with SSL | +
FORCETLS | +Set to 1 to enable TLS | +
FORWARDONLY | +When enabled, cursors are created as SQL_CURSOR_FORWARD_ONLY, | +
so they can only move forward. Starting in Connector/ODBC 3.2, cursors | ++ |
are SQL_CURSOR_FORWARD_ONLY | ++ |
by default. In previous releases, cursors are created as SQL_CURSOR_STATIC by | ++ |
default. | ++ |
NO_CACHE | +When enabled, result set streaming is enabled, which enables the | +
application to fetch result sets from the server row-by-row instead of | ++ |
caching the entire result set on the client side. Since the application | ++ |
is not caching the entire result set, the application is less likely to | ++ |
run out of memory when working with large result sets. | ++ |
STREAMRS | +Alias for the NO_CACHE connection | +
parameter. | ++ |
OPTIONS | +See about:blank#OPTIONS_Bitmaskabout:blank#OPTIONS_Bitmask. | +
PREPONCLIENT | +When enabled, the SQLPrepare ODBC API | +
function uses the text protocol and client-side prepared statements | ++ |
(CSPS). | ++ |
ATTR | +Sets connection attributes that can be queried via the https://www.notion.so../../../../ref/mdb/performance-schema/session_account_connect_attrs/ | +
and https://www.notion.so../../../../ref/mdb/performance-schema/session_connect_attrs/ | ++ |
tables when https://www.notion.so../../../../ref/mdb/system-variables/performance_schema/ | ++ |
is enabled. Specify attributes in the format ATTR={ |
++ |
OPTIONS
BitmaskThe OPTIONS
bitmask
+contains the following bits:
Bit Number | +Bit Value | +Description | +
---|---|---|
0 | +1 | +Unused | +
1 | +2 | +Tells connector to return the number of matched rows instead of | +
number of changed rows | ++ | + |
4 | +16 | +Same as NO_PROMPT connection | +
parameter | ++ | + |
5 | +32 | +Forces all cursors to be dynamic | +
6 | +64 | +Forbids the DATABASE_NAME.TABLE_NAME.COLUMN_NAME | +
syntax | ++ | + |
11 | +2048 | +Enables compression in the protocol | +
13 | +8192 | +Same as the NAMEDPIPE connection | +
parameter | ++ | + |
16 | +65536 | +Same as the USE_MYCNF connection | +
parameter | ++ | + |
20 | +1048576 | +Same as the NO_CACHE connection | +
parameter | ++ | + |
21 | +2097152 | +Same as the FORWARDONLY | +
connection parameter | ++ | + |
22 | +4194304 | +Same as the AUTO_RECONNECT | +
connection parameter | ++ | + |
26 | +67108864 | +Enables multi-statement queries | +
This page describes how to connect to a SkySQL database using a MariaDB-compatible client.
+Note
+The easiest way to get a SQL connection to any MariaDB database launched within your SkySQL account is through the built-in Query EditorĀ - run queries directly in the browser to interact with data stored in SkySQL databases.
+Note
+š” For Enterprise Server With Replica(s), you can also use any MongoDB client and use theĀ NoSQL InterfaceĀ .
+Once your DB service is launched, click on the āConnectā option for your service on the dashboard. This pops up all the required attributes to connect from any SQL client.
+Note
+š” Access to all services are protected by a firewall, by default. You need to IP whitelist your clientās (your desktop, laptop or server) IP. Just select āManage ā> Security Accessā and then click āAdd my current IPā to add the IP of your current workstation (laptop, desktop).
+Note
+š” If you are not sure or unable to obtain the IP address, you can use 0.0.0.0/0 to effectively disable the firewall. Goes without saying ā donāt do this for your production DBs.
+For more details go to theĀ FirewallĀ settings page.
+Connection parameters include:
+To connect to a service, you must also manage theĀ FirewallĀ settings and add the client's IP address or netblock to the allowlist.
+ +Service-specific Connection Parameters
+If using a mac, install MariaDB using brew install mariadb
. Go through MariaDB Client for details on how to connect from Linux or Windows.
Next, If you turned SSL, you need to download the āCertificate Authentication Chainā from the Connect popup.
+Finally, simply copy/paste the MariaDB CLI command as displayed in the Connect window.
+Applications can connect to MariaDB SkySQL DBs using any of the below MariaDB supported connectors. There are several other connectors from the community too.
+Clients listed here have been tested to properly connect with MariaDB SkySQL and execute queries.
+mariadb
), there are many compatibleĀ programming language connectorsĀ andĀ client applications.MariaDB SkySQL customers can import data into a SkySQL service using theĀ LOADĀ DATAĀ LOCALĀ INFILE
Ā SQL statement:
LOADĀ DATAĀ LOCALĀ INFILE
Ā statement can import data from TSV and CSV filesLOADĀ DATAĀ LOCALĀ INFILE
Ā statement can be executed by any client or connectorNote
+Make sure your schema is already created in the database. If you need to import entire databases or create tables, you should use mariab-import.
+Support for local infiles must be enabled on the client side and on the SkySQL service.
+To execute theĀ LOADĀ DATAĀ LOCALĀ INFILE
Ā statement, most clients and connectors require a specific option to be enabled.
If you are usingĀ mariadb
Ā client, theĀ --local-infile
Ā optionĀ must be specified.
Support for local infiles must be enabled on the SkySQL service.
+For SkySQL services that use MariaDB Enterprise Server and MariaDB Enterprise ColumnStore, theĀ local_infileĀ system variableĀ must be enabled:
+OFF
Ā by defaultConfiguration ManagerĀ can be used to modify the value of theĀ local_infileĀ system variable.
+mariadb
Ā client and specify theĀ -local-infileĀ option, which is needed by the next step:mariadb --host FULLY_QUALIFIED_DOMAIN_NAME --port TCP_PORT \
+ --user DATABASE_USER --password \
+ --ssl-verify-server-cert \
+ --ssl-ca ~/PATH_TO_PEM_FILE \
+ --default-character-set=utf8 \
+ --local-infile
+
After the command is executed, you will be prompted for a password. Enter the default password for your default user, the password you set for the default user, or the password for the database user you created.
+For each table that you want to import, execute theĀ LOADĀ DATAĀ LOCALĀ INFILEĀ statement to import the data from the TSV or CSV file into your MariaDB SkySQL database service.
+For a TSV file:
+LOAD DATA LOCAL INFILE 'contacts.tsv'
+INTO TABLE accounts.contacts;
+
For a CSV file:
+LOAD DATA LOCAL INFILE 'contacts.csv'
+INTO TABLE accounts.contacts
+FIELDS TERMINATED BY ',';
+
If you are using a MariaDB Connector, then you must select the method for the specific connector from the list below.
+If you are using MariaDB Connector/C, theĀ MYSQL_OPT_LOCAL_INFILE
Ā option can be set with theĀ mysql_optionsv()
Ā function:
/* enable local infile */
+unsigned int enable_local_infile = 1;
+mysql_optionsv(mysql, MYSQL_OPT_LOCAL_INFILE, (void *) &enable_local_infile);
+
If you are using MariaDB Connector/J, theĀ allowLocalInfile
Ā parameter can be set for the connection:
Connection connection = DriverManager.getConnection("jdbc:mariadb://FULLY_QUALIFIED_DOMAIN_NAME:TCP_PORT/test?user=DATABASE_USER&password=DATABASE_PASSWORD&allowLocalInfile=true");
+
If you are using MariaDB Connector/Node.js, theĀ permitLocalInfile
Ā parameter can be set for the connection:
mariadb.createConnection({
+ host: 'FULLY_QUALIFIED_DOMAIN_NAME',
+ port: 'TCP_PORT',
+ user:'DATABASE_USER',
+ password: 'DATABASE_PASSWORD',
+ permitLocalInfile: 'true'
+ });
+
If you are using MariaDB Connector/Python, theĀ local_infile
Ā parameter can be set for the connection:
conn = mariadb.connect(
+ user="DATABASE_USER",
+ password="DATABASE_PASSWORD",
+ host="FULLY_QUALIFIED_DOMAIN_NAME",
+ port=TCP_PORT,
+ local_infile=true)
+
Data can be loaded to SkySQL services with the assistance of SkySQL Support or by using self-service tools. When importing large data sets, we recommend working with SkySQL Support.
+Instructions are provided for the following data import methods:
+Data Import Method | +Use Case | +
---|---|
https://mariadb.com/docs/skysql-dbaas/data-operations/data-import/nr-support-assisted/ | +Coordinate data import with SkySQL Support | +
https://mariadb.com/docs/skysql-dbaas/data-operations/data-import/nr-load-data-local-infile/ | +Import TSV (tab-delimited) or CSV (comma-delimited) file data using theĀ LOADĀ DATAĀ LOCALĀ INFILEĀ statement with your database client | +
https://mariadb.com/docs/skysql-dbaas/data-operations/data-import/nr-mariadb-import/ | +Import TSV (tab-delimited) or CSV (comma-delimited) file data using theĀ mariadb-importĀ utility | +
To export data from a MySQL/MariaDB database and import it into MariaDB SkySQL, you can follow these steps:
+Start by using the mysqldump
command to export the data from the source database. This command allows you to create a backup of your database in a SQL file. For example, you can use the following command:
mysqldump -u [username] -p [database_name] > dump.sql
+
In this command, replace [username]
with your MySQL/MariaDB username and [database_name]
with the name of the database you want to export. The >
symbol redirects the output to a file named dump.sql
.
An optional step - Once you have exported the data, you need to transfer the dump.sql
file to the destination server where you can efficiently connect to your MariaDB SkySQL database. This is typically the same cloud provider region where your Sky DB is running.
CREATE DATABASE
statement. This step is necessary if you want to import the data into a new database. If you already have a database in which you want to import the data, you can skip this step.Finally, import the data from the dump.sql
file into the destination database using the mariadb or mysql
command. This command reads the SQL statements in the file and executes them in the specified database. Here's an example command:
## mariadb -u [username] -p [database_name] < dump.sql
+
+mariadb --host dbpwp27784332.orgtd5j0.db1.skysql.mariadb.com --port 3306 --user dbpwp27784332 -p [database_name] < dump.sql
+
Replace [hostname], username]
with your MariaDB SkySQL username and [database_name]
with the name of the destination database. The <
symbol is used to redirect the input from the file dump.sql
.
By following these steps, you will be able to export data from your MySQL/MariaDB database and import it into MariaDB SkySQL, ensuring a smooth transition of your data.
+ + + + +MariaDB SkySQL customers can manually create a backup of a SkySQL service using theĀ mariadb-dump
Ā utility:
mariadb-dump
Ā utility provides a command-line interface (CLI)mariadb-dump
Ā utility is available for Linux and Windowsmariadb-dump
Ā utility supportsĀ many command-line optionsFor details about restoring a backup created with theĀ mariadb-dump
Ā utility, see "Restore a Manual Backup".
Installation of MariaDB Dump varies by operating system.
+Configure YUM package repositories:
+`$ sudo yum install wget
+$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
+$ echo "935944a2ab2b2a48a47f68711b43ad2d698c97f1c3a7d074b34058060c2ad21b mariadb_repo_setup" \ | sha256sum -c -
+$ chmod +x mariadb_repo_setup
+$ sudo ./mariadb_repo_setup \ --mariadb-server-version="mariadb-10.6"`
+Install MariaDB Dump and package dependencies:
+$ sudo yum install MariaDB-client
Configure APT package repositories:
+`$ sudo apt install wget
+$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
+$ echo "935944a2ab2b2a48a47f68711b43ad2d698c97f1c3a7d074b34058060c2ad21b mariadb_repo_setup" \ | sha256sum -c -
+$ chmod +x mariadb_repo_setup
+$ sudo ./mariadb_repo_setup \ --mariadb-server-version="mariadb-10.6"$ sudo apt update`
+Install MariaDB Dump and package dependencies:
+$ sudo apt install mariadb-client
Configure ZYpp package repositories:
+`$ sudo zypper install wget
+$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
+$ echo "935944a2ab2b2a48a47f68711b43ad2d698c97f1c3a7d074b34058060c2ad21b mariadb_repo_setup" \ | sha256sum -c -
+$ chmod +x mariadb_repo_setup
+$ sudo ./mariadb_repo_setup \ --mariadb-server-version="mariadb-10.6"`
+Install MariaDB Dump and package dependencies:
+$ sudo zypper install MariaDB-client
The procedure to create a backup depends on the operating system.
+If you plan to restore the backup to a SkySQL service, theĀ mysql
Ā database should be excluded from the backup by specifyingĀ [--ignore-database=mysql](https://mariadb.com/docs/skysql-dbaas/ref/mdb/cli/mariadb-dump/ignore-database/)
, because SkySQL user accounts do not have sufficient privileges to restore that database.
mariadb-dump --host FULLY_QUALIFIED_DOMAIN_NAME --port TCP_PORT \
+ --user DATABASE_USER --password \
+ --ssl-verify-server-cert \
+ --ssl-ca ~/PATH_TO_PEM_FILE \
+ --all-databases \
+ --ignore-database=mysql \
+ --single-transaction \
+ --events \
+ --routines \
+ --default-character-set=utf8mb4 \
+ > skysql_dump.sql
+
FULLY_QUALIFIED_DOMAIN_NAME
Ā with the Fully Qualified Domain Name of your service.TCP_PORT
Ā with the read-write or read-only port of your service.DATABASE_USER
Ā with the default username for your service, or the username you created.~/PATH_TO_PEM_FILE
Ā with the path to the certificate authority chain (.pem) file.After the command is executed, you will be prompted for a password. Enter the default password for your default user, the password you set for the default user, or the password for the database user you created.
+Fix your executable search path.
+On Windows, MariaDB Dump is not typically found in the executable search path by default. You must find its installation path, and add that path to the executable search path:
+$ SET "PATH=C:\Program Files\MariaDB 10.6\bin;%PATH%"
Determine theĀ connection parametersĀ for your MariaDB SkySQL service.
+mariadb-dump --host FULLY_QUALIFIED_DOMAIN_NAME --port TCP_PORT \
+ --user DATABASE_USER --password \
+ --ssl-verify-server-cert \
+ --ssl-ca ~/PATH_TO_PEM_FILE \
+ --all-databases \
+ --ignore-database=mysql \
+ --single-transaction \
+ --events \
+ --routines \
+ --default-character-set=utf8mb4 \
+ > skysql_dump.sql
+
FULLY_QUALIFIED_DOMAIN_NAME
Ā with the Fully Qualified Domain Name of your service.TCP_PORT
Ā with the read-write or read-only port of your service.DATABASE_USER
Ā with the default username for your service, or the username you created.PATH_TO_PEM_FILE
Ā with the path to the certificate authority chain (.pem) file.After the command is executed, you will be prompted for a password. Enter the default password for your default user, the password you set for the default user, or the password for the database user you created.
+The instructions provided above are written for MariaDB Dump 10.4 and later, which uses the binary filename ofĀ mariadb-dump
.
For MariaDB Dump 10.3 and older, the binary filename wasĀ mysqldump
. The instructions can be adapted for MariaDB Dump 10.3 and older by executingĀ mysqldump
Ā rather thanĀ mariadb-dump
.
For system-versioned tables and transaction-precise tables, MariaDB Dump only backs up current row versions. It does not back up historical row versions.
+ + + + + + + + + + + + + +MariaDB SkySQL customers can import data into a SkySQL service using theĀ mariadb-import
Ā utility:
mariadb-import
Ā utility provides a command-line interface (CLI)mariadb-import
Ā utility can import data from TSV and CSV filesmariadb-import
Ā utility is available for Linux and Windowsmariadb-import
Ā utility supportsĀ many command-line optionsInstallation of MariaDB Import varies by operating system.
+Configure YUM package repositories:
+`$ sudo yum install wget
+$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
+$ echo "935944a2ab2b2a48a47f68711b43ad2d698c97f1c3a7d074b34058060c2ad21b mariadb_repo_setup" \ | sha256sum -c -
+$ chmod +x mariadb_repo_setup
+$ sudo ./mariadb_repo_setup \ --mariadb-server-version="mariadb-10.6"`
+Install MariaDB Import and package dependencies:
+$ sudo yum install MariaDB-client
Configure APT package repositories:
+`$ sudo apt install wget
+$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
+$ echo "935944a2ab2b2a48a47f68711b43ad2d698c97f1c3a7d074b34058060c2ad21b mariadb_repo_setup" \ | sha256sum -c -
+$ chmod +x mariadb_repo_setup
+$ sudo ./mariadb_repo_setup \ --mariadb-server-version="mariadb-10.6"$ sudo apt update`
+Install MariaDB Import and package dependencies:
+$ sudo apt install mariadb-client
Configure ZYpp package repositories:
+`$ sudo zypper install wget
+$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
+$ echo "935944a2ab2b2a48a47f68711b43ad2d698c97f1c3a7d074b34058060c2ad21b mariadb_repo_setup" \ | sha256sum -c -
+$ chmod +x mariadb_repo_setup
+$ sudo ./mariadb_repo_setup \ --mariadb-server-version="mariadb-10.6"`
+Install MariaDB Import and package dependencies:
+$ sudo zypper install MariaDB-client
The procedure to import data depends on the operating system.
+Use MariaDB Import with the connection information to import the data from the TSV or CSV file into your MariaDB SkySQL database service:
+mariadb-import --host FULLY_QUALIFIED_DOMAIN_NAME --port TCP_PORT \
+ --user DATABASE_USER --password \
+ --ssl-verify-server-cert \
+ --ssl-ca ~/PATH_TO_PEM_FILE \
+ --local \
+ --ignore-lines=1 \
+ accounts contacts.tsv
+
FULLY_QUALIFIED_DOMAIN_NAME
Ā with the Fully Qualified Domain Name of your serviceTCP_PORT
Ā with the read-write or read-only port of your serviceDATABASE_USER
Ā with the default username for your service, or the username you created~/PATH_TO_PEM_FILE
Ā with the path to the certificate authority chain (.pem) file-fields-terminated-by=,
accounts
)contacts
)Fix your executable search path.
+On Windows, MariaDB Import is not typically found in the executable search path by default. You must find its installation path, and add that path to the executable search path:
+$ SET "PATH=C:\Program Files\MariaDB 10.6\bin;%PATH%"
Determine theĀ connection parametersĀ for your MariaDB SkySQL service.
+Use MariaDB Import with the connection information to import the data from the TSV or CSV file into your MariaDB SkySQL database service:
+mariadb-import --host FULLY_QUALIFIED_DOMAIN_NAME --port TCP_PORT \
+ --user DATABASE_USER --password \
+ --ssl-verify-server-cert \
+ --ssl-ca ~/PATH_TO_PEM_FILE \
+ --local \
+ --ignore-lines=1 \
+ accounts contacts.tsv
+
FULLY_QUALIFIED_DOMAIN_NAME
Ā with the Fully Qualified Domain Name of your serviceTCP_PORT
Ā with the read-write or read-only port of your serviceDATABASE_USER
Ā with the default username for your service, or the username you created~/PATH_TO_PEM_FILE
Ā with the path to the certificate authority chain (.pem) file-fields-terminated-by=,
accounts
)contacts
)The instructions provided above are written for MariaDB Import 10.4 and later, which uses the binary filename ofĀ mariadb-import
.
For MariaDB Import 10.3 and older, the binary filename wasĀ mysqlimport
. The instructions can be adapted for MariaDB Import 10.3 and older by executingĀ mysqlimport
Ā rather thanĀ mariadb-import
.
Databases can be migrated to MariaDB SkySQL from many different database platforms, including Oracle, MySQL, PostgreSQL, Microsoft SQL Server, IBM DB2, and more
+To perform a lift-and-shift migration to SkySQL, use the following process:
+SkySQL customers can receive assistance from SkySQL Inc when migrating a database to SkySQL:
+For assistance with a migration:
+We use a multi-step process to assist customers with migrations:
+For additional information, see "Whitepaper: Migrate to MariaDB from Oracle".
+This blog article details how to Migrate RDS MySQL to SkySQL MariaDB Using AWS Data Migration Service
+Click here for a detailed walk through of the steps involved.
+For assistance with a migration:
+MariaDB SkySQL customers can configure inbound replication from MySQL 5.7 to a compatible MariaDB running in SkySQL.
+For additional information about the stored procedures used to configure replication with Replicated Transactions services, see "SkySQL Replication Helper Procedures for Replicated Transactions".
+ + +On the external primary server, obtain the binary log file and position from which to start replication.
+When you want to start replication from the most recent transaction, the current binary log file position can be obtained by executing theĀ SHOWĀ MASTERĀ STATUS
Ā statement:
**SHOW** MASTER STATUS**;**
+------------------+----------+--------------+------------------+-------------------+
+| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
++------------------+----------+--------------+------------------+-------------------+
+| mysql-bin.000001 | 154 | | | |
++------------------+----------+--------------+------------------+-------------------+
On the SkySQL service, configure the binary log file and position from which to start replication.
+The binary log file and position can be configured using theĀ [sky.change_external_primary()
Ā stored procedure](https://mariadb.com/docs/skysql-previous-release/ref/replication-procedures/replicated-transactions/#change_external_primary):
CALL sky.change_external_primary('mysql1.example.com', 3306, 'mysql-bin.000001', 154, false);
+
GRANT REPLICATION SLAVE ON . TO 'skysql_replication'@'%' IDENTIFIED BY '
On the external primary server, execute theĀ [GRANT](https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/GRANT/)
Ā statement returned by the last step:
GRANT REPLICATION SLAVE ON *.* TO 'skysql_replication'@'%' IDENTIFIED BY '<password_hash>';
+
On the SkySQL service, start replication.
+Replication can be started using theĀ [sky.start_replication()
Ā stored procedure](https://mariadb.com/docs/skysql-previous-release/ref/replication-procedures/replicated-transactions/#start_replication):
CALL sky.start_replication();
++----------------------------------------+
+| Message |
++----------------------------------------+
+| External replication running normally. |
++----------------------------------------+
+
On the SkySQL service, check replication status.
+Replication status can be checked using theĀ [sky.replication_status()
Ā stored procedure](https://mariadb.com/docs/skysql-previous-release/ref/replication-procedures/replicated-transactions/#replication_status):
**CALL** sky**.**replication_status**()\G**
+
*************************** 1. row ***************************
+ Slave_IO_State: Waiting for master to send event
+ Master_Host: mariadb1.example.com
+ Master_User: skysql_replication
+ Master_Port: 3306
+ Connect_Retry: 60
+ Master_Log_File: mysql-bin.000001
+ Read_Master_Log_Pos: 462
+ Relay_Log_File: mariadb-relay-bin.000002
+ Relay_Log_Pos: 665
+ Relay_Master_Log_File: mysql-bin.000001
+ Slave_IO_Running: Yes
+ Slave_SQL_Running: Yes
+ Replicate_Do_DB:
+ Replicate_Ignore_DB:
+ Replicate_Do_Table:
+ Replicate_Ignore_Table:
+ Replicate_Wild_Do_Table:
+ Replicate_Wild_Ignore_Table:
+ Last_Errno: 0
+ Last_Error:
+ Skip_Counter: 0
+ Exec_Master_Log_Pos: 462
+ Relay_Log_Space: 985
+ Until_Condition: None
+ Until_Log_File:
+ Until_Log_Pos: 0
+ Master_SSL_Allowed: No
+ Master_SSL_CA_File:
+ Master_SSL_CA_Path:
+ Master_SSL_Cert:
+ Master_SSL_Cipher:
+ Master_SSL_Key:
+ Seconds_Behind_Master: 0
+ Master_SSL_Verify_Server_Cert: No
+ Last_IO_Errno: 0
+ Last_IO_Error:
+ Last_SQL_Errno: 0
+ Last_SQL_Error:
+ Replicate_Ignore_Server_Ids:
+ Master_Server_Id: 200
+ Master_SSL_Crl:
+ Master_SSL_Crlpath:
+ Using_Gtid: No
+ Gtid_IO_Pos:
+ Replicate_Do_Domain_Ids:
+ Replicate_Ignore_Domain_Ids:
+ Parallel_Mode: conservative
+ SQL_Delay: 0
+ SQL_Remaining_Delay: NULL
+ Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
+ Slave_DDL_Groups: 0
+Slave_Non_Transactional_Groups: 0
+ Slave_Transactional_Groups: 0
+
When replicating from another MariaDB DB you can directly use GTID based replication. The first two steps are different than MySQL.
+On the external primary server, obtain the GTID position from which to start replication.
+When you want to start replication from the most recent transaction, the current GTID position can be obtained by querying the value of theĀ [gtid_current_pos](https://mariadb.com/docs/skysql-previous-release/ref/mdb/system-variables/gtid_current_pos/)
Ā system variable with theĀ [SHOWĀ GLOBALĀ VARIABLES](https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/SHOW_VARIABLES/)
Ā statement:
**SHOW** **GLOBAL** VARIABLES **LIKE** 'gtid_current_pos'**;**
+------------------+---------+
+| Variable_name | Value |
++------------------+---------+
+| gtid_current_pos | 0-100-1 |
++------------------+---------+
On the SkySQL service, configure the GTID position from which to start replication.
+The GTID position can be configured using theĀ [sky.change_external_primary_gtid()
Ā stored procedure](https://mariadb.com/docs/skysql-previous-release/ref/replication-procedures/replicated-transactions/#change_external_primary_gtid):
**CALL** sky**.**change_external_primary_gtid**(**'mariadb1.example.com'**,** 3306**,** '0-100-1'**,** **false);**
+--------------------------------------------------------------------------------------------------------------+
+| Run_this_grant_on_your_external_primary |
++--------------------------------------------------------------------------------------------------------------+
+| GRANT REPLICATION SLAVE ON *.* TO 'skysql_replication'@'%' IDENTIFIED BY '<password_hash>'; |
++--------------------------------------------------------------------------------------------------------------+
The stored procedure returns aĀ [GRANT](https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/GRANT/)
Ā statement that is used in the next step.
To configure inbound replication from an external primary server using MariaDB Server to your Replicated Transactions service in SkySQL, the following requirements must be met:
+MariaDB SkySQL customers can configure outbound replication from a Replicated Transactions service to a compatible MariaDB Server running elsewhere - could be your data center, self-managed MariaDB DB on the cloud or even other managed services like AWS RDS.
+SkySQL uses stored procedures to configure replication to other MariaDB or MySQL database servers.
+For additional information about the stored procedures used to configure replication with Replicated Transactions services, see "SkySQL Replication Helper Procedures for Replicated Transactions".
+To configure outbound replication from your Replicated Transactions service in SkySQL to an external replica server using MariaDB Server, the following requirements must be met:
+On the SkySQL Customer Portal,Ā create a support caseĀ to request a user account with sufficient privileges for outbound replication to the external replica server.
+SkySQL customers do not have sufficient privileges to create a user account that supports replication, so the user account must be created by SkySQL Support.
+ + +On the SkySQL service, confirm that the new user has sufficient privileges by executingĀ [SHOWĀ GRANTS](https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/SHOW_GRANTS/)
:
**SHOW** GRANTS **FOR** 'external_replication'@'%'**;**
+------------------------------------------------------------------------------------------------------------------------------------------------+
+| Grants for external_replication@% |
++------------------------------------------------------------------------------------------------------------------------------------------------+
+| GRANT REPLICATION SLAVE, SLAVE MONITOR ON *.* TO
external_replication@
%IDENTIFIED BY PASSWORD '*CCD3A959D6A004B9C3807B728BC2E55B67E10518' |
++------------------------------------------------------------------------------------------------------------------------------------------------+
On the SkySQL Customer Portal, add the IP address of the external replica server to the SkySQL service'sĀ allowlist. Click āManageāā āManage Allowlistā to add the IP address to the allowed list.
+ + +On the SkySQL service, obtain the GTID position from which to start replication.
+When you want to start replication from the most recent transaction, the current GTID position can be obtained by querying the value of theĀ [gtid_current_pos](https://mariadb.com/docs/skysql-previous-release/ref/mdb/system-variables/gtid_current_pos/)
Ā system variable with theĀ [SHOWĀ GLOBALĀ VARIABLES](https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/SHOW_VARIABLES/)
Ā statement:
**SHOW** **GLOBAL** VARIABLES **LIKE** 'gtid_current_pos'**;**
+------------------+-------------------+
+| Variable_name | Value |
++------------------+-------------------+
+| gtid_current_pos | 435700-435700-124 |
++------------------+-------------------+
On the external replica server, configure the GTID position from which to start replication.
+The GTID position can be configured by setting theĀ [gtid_slave_pos](https://mariadb.com/docs/skysql-previous-release/ref/mdb/system-variables/gtid_slave_pos/)
Ā system variable with theĀ [SETĀ GLOBAL](https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/SET/)
Ā statement:
**SET** **GLOBAL** gtid_slave_pos='435700-435700-124'**;**
If you have enabled SSL (default), on the external replica server, download theĀ SkySQL CA chain. This is available in the Connect popup window on the portal dashboard.
+On the external replica server, configure replication using theĀ connection parametersĀ for your MariaDB SkySQL service.
+Replication can be configured using theĀ [CHANGEĀ MASTERĀ TO](https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/CHANGE_MASTER_TO/)
Ā statement:
CHANGE MASTER TO
+ MASTER_HOST='FULLY_QUALIFIED_DOMAIN_NAME',
+ MASTER_PORT=TCP_PORT,
+ MASTER_USER='external_replication',
+ MASTER_PASSWORD='my_password',
+ MASTER_SSL=1,
+ MASTER_SSL_CA='~/PATH_TO_PEM_FILE',
+ MASTER_USE_GTID=slave_pos;
+
FULLY_QUALIFIED_DOMAIN_NAME
Ā with the Fully Qualified Domain Name of your serviceTCP_PORT
Ā with the read-write or read-only port of your service~/PATH_TO_PEM_FILE
Ā with the path to the certificate authority chain (.pem) fileOn the external replica server, start replication.
+Replication can be started using theĀ [STARTĀ REPLICA](https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/START_REPLICA/)
Ā statement:
**START** REPLICA**;**
On the external replica server, check replication status.
+Replication status can be checked using theĀ [SHOWĀ REPLICAĀ STATUS](https://mariadb.com/docs/skysql-previous-release/ref/mdb/sql-statements/SHOW_REPLICA_STATUS/)
Ā statement:
**SHOW** REPLICA STATUS**\G**
*************************** 1. row ***************************
+ Slave_IO_State: Waiting for master to send event
+ Master_Host: my-service.mdb0002147.db.skysql.net
+ Master_User: external_replication
+ Master_Port: 5003
+ Connect_Retry: 60
+ Master_Log_File: mariadb-bin.000001
+ Read_Master_Log_Pos: 558
+ Relay_Log_File: mariadb-relay-bin.000002
+ Relay_Log_Pos: 674
+ Relay_Master_Log_File: mariadb-bin.000001
+ Slave_IO_Running: Yes
+ Slave_SQL_Running: Yes
+ Replicate_Do_DB:
+ Replicate_Ignore_DB:
+ Replicate_Do_Table:
+ Replicate_Ignore_Table:
+ Replicate_Wild_Do_Table:
+ Replicate_Wild_Ignore_Table:
+ Last_Errno: 0
+ Last_Error:
+ Skip_Counter: 0
+ Exec_Master_Log_Pos: 558
+ Relay_Log_Space: 985
+ Until_Condition: None
+ Until_Log_File:
+ Until_Log_Pos: 0
+ Master_SSL_Allowed: Yes
+ Master_SSL_CA_File: /var/lib/mysql/skysql_chain.pem
+ Master_SSL_CA_Path:
+ Master_SSL_Cert:
+ Master_SSL_Cipher:
+ Master_SSL_Key:
+ Seconds_Behind_Master: 0
+ Master_SSL_Verify_Server_Cert: No
+ Last_IO_Errno: 0
+ Last_IO_Error:
+ Last_SQL_Errno: 0
+ Last_SQL_Error:
+ Replicate_Ignore_Server_Ids:
+ Master_Server_Id: 435701
+ Master_SSL_Crl: /var/lib/mysql/skysql_chain.pem
+ Master_SSL_Crlpath:
+ Using_Gtid: Slave_Pos
+ Gtid_IO_Pos: 435700-435700-127
+ Replicate_Do_Domain_Ids:
+ Replicate_Ignore_Domain_Ids:
+ Parallel_Mode: optimistic
+ SQL_Delay: 0
+ SQL_Remaining_Delay: NULL
+ Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
+ Slave_DDL_Groups: 0
+Slave_Non_Transactional_Groups: 0
+ Slave_Transactional_Groups: 0
+
Note
+TODO - this section needs detailed review
+The simplest way to offload your database is to use theĀ mariadb-dump
Ā utility:
mariadb-dump
Ā utility provides a command-line interface (CLI)mariadb-dump
Ā utility is available for Linux and Windowsmariadb-dump
Ā utility supportsĀ many command-line optionsmariadb-dump
usage is fully described here.
UseĀ MariaDB ClientĀ with the connection information to export your schema from your MariaDB SkySQL database service. Here is an example to export all rows from a single table:
+mariadb --host FULLY_QUALIFIED_DOMAIN_NAME --port TCP_PORT \
+ --user DATABASE_USER --password \
+ --ssl-verify-server-cert \
+ --ssl-ca ~/PATH_TO_PEM_FILE \
+ --default-character-set=utf8 \
+ --batch \
+ --skip-column-names \
+ --execute='SELECT * FROM accounts.contacts;' \
+ > contacts.tsv
+
FULLY_QUALIFIED_DOMAIN_NAME
Ā with the Fully Qualified Domain Name of your service.TCP_PORT
Ā with the read-write or read-only port of your service.DATABASE_USER
Ā with the default username for your service, or the username you created.~/PATH_TO_PEM_FILE
Ā with the path to the certificate authority chain (.pem) file.you can use the SELECT INTO OUTFILE
statement to export query results directly to a file. This is useful for exporting specific data from tables.
Usage:
+SELECT * INTO OUTFILE '/path/to/file.csv' FIELDS TERMINATED BY ',' FROM your_table;
+
Note
+Note that this file system export is not directly accessible to SkySQL users. To generate CSV files, you should contact SkySQL support.
+SkySQL is a database-as-a-service (DBaaS) that was originally developed and managed by MariaDB Corporation. The cloud division (SkySQL) was later spun out of MariaDB into a independent company - SkySQL Inc. The team that developed SkySQL transitioned over to the new company.
+Our platform and experts handle the infrastructure needs, allowing you to focus on your core business.
+When you choose SkySQL, a full-featured DBaaS, you forego the capital expenditure of buying hardware, the delay of waiting for new systems to ship every time you need to scale-up or scale-out, and the overhead and opportunity-cost of tuning, monitoring, and upgrading your database. SkySQL also handles routine tasks such as nightly backups and infrastructure maintenance.
+And if you need ultimate control, and have the necessary skills and resources to hand-pick instances and tune configurations, we offer SkySQLĀ Power TierĀ to deliver all of the on-premises benefits without the capex (capital expense) and operational overhead.
+In Foundation Tier smaller databases launch in 2-4 mins. Power Tier deployments with isolated, dedicated Kubernetes environments can take up to 25 minutes. Subsequent database deployments will use the same Kubernetes environment and usually launch in 2-4 minutes.
+The real time benefits come every day after, when you're operating at scale. A failed database node can recover in a matter of seconds using Kubernetes self-healing, or instantly failover to alternate replicated server. Instead of an eight-hour bare metal rebuild as you might see on-premises or on other cloud platforms.
+SkySQL provides services backed by:
+No, SkySQL is dedicated to being the top choice for MariaDB. Our goal is to provide the best price-performance of any DBaaS, offer significant productivity improvements through automation, and serve as the most comprehensive end-to-end platform for all your database needs.
+We offer āfractional DBAsā - expert-maintained multi-cloud databases. We're glad to help with your move to SkySQL, whether you'reĀ migratingĀ from another database platform or looking toĀ lift-and-shiftĀ a MariaDB implementation to SkySQL.
+SkySQL is multi-cloud and as a full-featured DBaaS we handle all of the hardware and infrastructure needs.
+Services are currently available with a range ofĀ instance sizesĀ running on:
+Transactional services (such as our Replicated Transactions topology) operate on:
+SkySQL runs on Amazon Elastic Kubernetes Service (EKS), Google Kubernetes Engine (GKE), and MariaDB database products - Enterprise Server, Maxscale. MariaDB Enterprise Server enables a predictable development and operations experience through optimized builds, predictable release behavior, and vendor support.
+SkySQLĀ officially launchedĀ as a production-ready enterprise-grade DBaaS in 2020, after extensive pre-release testing.
+Yes. SkySQL delivers enterprise-grade cloud database services for mission-critical applications. SkySQL is built to make MariaDB Enterprise ready - optimized for security, stability, and reliability in demanding production environments. Multi-node database deployments feature a comprehensiveĀ SLA, High Availability (HA) features, and operations features.Ā Enterprise supportĀ options extend support to 24x7, with the additional option ofĀ SkyDBAĀ for reactive and proactive assistance from a team of expert DBAs.Ā Security featuresĀ are designed to meet the GRC and infosec challenges faced by modern applications, andĀ DPA (GDPR) and BAA (HIPAA)Ā are available.
+SkySQL is primarily designed for online applications and offers two topologies -
+Replicated Transactions, Single Node Transactions
+You can chooseĀ topologies to match your workload requirements, cloud regions to match your latency and operating requirements, instance sizes,Ā andĀ support plan.
+Our platform features:
+Estimated SkySQL pricing is available from theĀ SkySQL portal. SkySQL pricing is very competitive and starts at about $100 per month for production grade databases.
+SkySQL pricing varies based on the selections made when youĀ launch a service. Examples of selections include provider, topology, instance and storage size, and region.
+The pricing shown is not a quote and does not guarantee the cost for your actual use of SkySQL services, as is shown on monthly invoices. The cost estimate can vary from your actual costs forĀ several reasons.
+No. Purchase of SkySQL service includesĀ supportĀ and access toĀ MariaDB database products on SkySQL.
+Yes. SkySQL is listed in the Google Cloud Marketplace. Customers have the ability to retire their GCP commitment with a SkySQL subscription via the Marketplace.
+ +Contact usĀ if you have further questions.
+Yes. SkySQL is an AWS partner network. Customers can retire their AWS commitment with a SkySQL subscription via the AWS Marketplace.
+See the AWS Marketplace listing
+Contact usĀ if you have further questions.
+Estimated SkySQL pricing information is shown when youĀ create a serviceĀ based on the selections you make at launch time, such as topology, region, and instance size. PleaseĀ contact usĀ for assistance in cost estimation, includingĀ supportĀ andĀ Power Tier.
+SkySQL pricing includes instances for a specific service topology, and monitoring, and also includes management features, e.g., backups, upgrades, patch installs, etc.Ā Some factors, such as object storage and network egress which are variable and usage-dependent, are not included in estimated pricing. We typically pass-thru the cloud provider costs with no additional markup.
+Add-ons are available to optimize your SkySQL experience:
+Yes. Discounts are typically offered for one-year and three-year commitments. PleaseĀ contact usĀ for more information.
+SkySQL accepts payment byĀ major credit card and through remittance accounts
+SkySQL accepts all major credit cards. Specifically, we accept Visa, Mastercard, American Express, Discover, and Diners Club payments from customers worldwide.
+Note
+SkySQL does not store any of your credit card information. We use Stripe to manage all credit card transactions. Stripe is a widely used payment processing platform that enables businesses to accept credit card payments securely
+Contact usĀ to have your account set up for payment by wire transfer or ACH.
+SkySQL contract customers can pre-fund their account.Ā Contact usĀ for more information.
+SkySQL charges are paid using a credit card, or via wire transfer/ACH upon invoice in the case of remittance accounts.
+Yes. We offer direct purchase through the AWS Marketplace or we can craft a "private offer" to customize a subscription.
+See the AWS Marketplace listing
+Contact usĀ if you have further questions.
+Yes. SkySQL is an AWS partner network. Customers can retire their AWS commitment with a SkySQL subscription via the AWS Marketplace.
+See the AWS Marketplace listing
+Contact usĀ if you have further questions.
+Yes. We offer direct purchase through the Google Marketplace or we can craft a "private offer" to customize a subscription.
+ +Contact usĀ if you have further questions.
+Yes. SkySQL is listed in the Google Cloud Marketplace. Customers have the ability to retire their GCP commitment with a SkySQL subscription via the Marketplace.
+ +Contact usĀ if you have further questions.
+If youĀ stop a SkySQL service, you will continue to be charged for storage, since your data is not deleted. Instance and egress charges will stop until the instance is started again.
+Current month'sĀ estimated chargesĀ can be viewed on the SkySQL portal dashboard. Detailed information is also available under āBillingā where you can see the breakdown for all your current charges - you can see resource usage by Service Name (your individual DB clusters) or by resource type. Variable charges such as object storage and network egress are updated the day prior to the last day of the month and are available in the invoice. You can also use the SkySQL REST API to fetch usage and billing data.
+SkySQL invoices are sent monthly and include a detailed breakdown of usage, pricing, and taxes. For Team accounts, only the Team owner has access to Account Information.
+Invoices for SkySQL are sent by email on subscription renewal. Subscription renewal occurs on the last day of the month. Accounts using a credit card are charged at this time.
+MariaDB will bill for VAT and/or taxes in applicable jurisdictions. Customers are responsible for paying all applicable taxes and fees. See theĀ SkySQL Terms of UseĀ for additional information.
+Current month'sĀ estimated charges, including coupons and service credits, can be viewed on theĀ Account InformationĀ page and are updated six times per day.
+In the event of service credits issued based onĀ SLA, service credits will be included in coupons and service credits on theĀ Account InformationĀ page.
+Instances can beĀ stoppedĀ to save money. While stopped, additional instance and egress charges will not accrue, but you will continue to be charged for storage.
+ContactĀ info@skysql.comĀ with billing questions.
+SkySQL runs full backups automatically each night. SkySQL also allows on-demand backups (a Preview feature)
+No. Backup frequency and schedule are not customer configurable. SkySQL Power Tier customers should contact us if alternate backup frequency or schedule is required.
+No. Data is not sent to another country. All data is managed within the same region where your database is running for data sovereignty.
+No.
+No.
+MariaDB Enterprise Backup (mariabackup) is used for Replicated Transactions and Single Node Transactions service backups. MariaDB Enterprise Backup breaks up backups into non-blocking stages so writes and schema changes can occur during backups.
+The backup service provides support for incremental backups. It is in preview state (Dec 2023).
+Backups for running and stopped services are retained for 30 days. If a service is deleted, no further backups for that service are produced and backups on hand are purged after 7 days.
+No. Backup retention is not customer configurable. SkySQL Power Tier customers should contact us if an alternate retention schedule is required.
+Request data restore by creating a support case in theĀ Customer Support Portal. Please state what you need restored, and the desired restore point. Self service Restore functionality is available using the Backup service and API (in Preview as of Dec 2023)
+Yes, byĀ support case.
+By default, full and complete backup restoration is available. To enable point-in-time recovery, services must be configured in advance for additional binary log retention.Ā Point-in-time recovery (PITR)Ā configuration is available toĀ Power TierĀ customers.
+Yes, byĀ support case
+Yes, byĀ support case
+Yes, you can retrieve your database. No, there is no vendor lock. Your data is your data. Create aĀ support caseĀ for access to a backup.
+Yes. All SkySQL data is encrypted on disk.
+By default, SkySQL services feature data-in-transit encryption for client connections.
+By default, server-to-server communications between the nodes of a SkySQL service are protected with data-in-transit encryption.
+For additional information, see "Data-in-Transit Encryption".
+Yes. By default, SkySQL requires client connections via TLS (TLS 1.2, TLS 1.3).
+SkySQL supportsĀ disabling SSL/TLS via the Portal or using the API.
+SkySQL on Amazon AWS benefits fromĀ Amazon EBS encryption, which is AES256.
+SkySQL on Google GCP leverages Google'sĀ default encryption, which is AES256 or AES128.
+TLS 1.2, and TLS 1.3 are supported.
+TLS certificates expire every two years.
+MariaDB Corporation leverages HashiCorp Vault for certificate and key management. Certificates and keys are not customer-configurable.
+No. SkySQL supports server-side certificates. Database users are authenticated by standard password authentication, LDAP, and/or Two-Factor Authentication (2FA).
+No. While MariaDB Enterprise Server includes ed25519 support, SkySQL leverages a version of MariaDB MaxScale which is not ed25519-compatible.
+A certificate authority chain is provided to allow your client to establish a secure and encrypted connection to a SkySQL database service, confirming the authenticity of the server certificate.
+Cryptography libraries are included in our standard release process, and vulnerability scanning is conducted for each release.
+Yes. The decision to delete your running service rests with you and your business. Please consider production impacts before deleting a service. SkySQL permits the on-demand deletion of running and stopped services.
+No. The launch process must complete before deletion is permitted.
+All data residing on a service's storage is deleted at time of service deletion. Backups for deleted services are purged after 7 days.
+Maybe. If you contact us before the system completes data deletion, yes, we can recover. Backups for deleted services are purged after 7 days.
+No. You should download your data so you have a local copy before you delete the service.
+No. SkySQL is hosted on public cloud provider systems.
+Yes. If you would like backups purged, pleaseĀ create a support case
+You can SkySQL Monitoring after launching a service, then clicking the "Monitoring" link in the SkySQL main menu (left navigation).
+SkySQL Monitoring covers status and metrics specific to a service and its servers. AĀ complete list of chartsĀ is provided.
+SkySQL Incās Support and SRE teams are alerted if a SkySQL service becomes unavailable or when serious issues are detected (e.g. disk is 90% utilized).
+Additionally, SkySQL automatically turns on several sensible alerting rules so the customer can also be alerted.
+SkySQL Monitoring includes alerting features, which allow configurable alerting rules, notification channels, and notification criteria. These settings are managed from the SkySQL Monitoring interface. You can SkySQL Monitoring after launching a service by clicking the "Monitoring" link in the SkySQL main menu (left navigation).
+SkySQL customers can contact us via theĀ Customer Support Portal.
+If you are not yet a SkySQL customer, pleaseĀ contact usĀ with questions.
+Included with Foundation Tier services:
+Available to Power Tier customers:
+SeeĀ full details of our support options.
+Yes.Ā Enterprise support levels are available for customers requiring 24x7x365 support (24 hours per day, 7 days per week, 365 (or 366) days per year).
+Yes. SkySQL infrastructure is fully managed, including many typical operations features such as automated nightly backups and monitoring.
+Standard support is included with Foundation Tier services. Activities like performance tuning and assistance with schema change is not included in standard support. Power Tier customers choose between Enterprise and Platinum support options, which include consultative support.
+Our optionalĀ SkyDBAĀ service is available for Enterprise and Platinum support customers, and SkyDBA customers receive both reactive (break/fix) and proactive (analyze/enhance) assistance.
+SkySQL offers a full range of professional services, including:
+Contact SkySQL IncĀ or email us at info@skysql.ai
+Release notesĀ are provided to show changes to SkySQL services, features, interfaces, and documentation.
+SkySQL is available for immediate use.Ā Sign upĀ today andĀ get started. If you would like assistance from sales,Ā contact us.
+Billing questions can be directed to accounts receivable atĀ billing@mariadb.com
+To aid our continuous improvement efforts, we encourage you to provide feedback on our documentation and your experiences using it via the following:
+SkySQL customers can contact us via theĀ Customer Support Portal
+ + + + + + + + + + + + + +SkyDBA is a "Fractional" DBA Service, a cost-effective solution for businesses that need database administration but do not require a full-time database administrator. This service provides access to a team of experienced database administrators on a part-time basis. Whether it's for routine maintenance, troubleshooting, or strategic advice, SkyDBA's Fractional DBA Service ensures that expert assistance is just a call away. This approach not only saves the expense of a full-time employee but also provides a higher level of service due to the collective knowledge and experience of the SkyDBA team.
+Note
+SkyDBA is an optional service that you can purchase. You can avail of this service regardless of the Tier (Foundation or Power) used to deploy DB services. For more information, please contact SkySQL support
+Here is what you can expect from this āadd-onā service.
+Expert advice available on migration methodology and procedures.
+Get expert advice on poorly performing in operation queries. Upon request, SkyDBAās can also create indexes or perform other DDL changes to help improve performance or reliability.
+With a SkyDBA subscription, your customer success manager can schedule quarterly business reviews with someone from the SkyDBA team to review items such as:
+Work with the SkyDBA team to ensure that your environment is safe and secure. This includes auditing of users and grants.
+The SkyDBA team will be alerted when events occur on your instances that could impact your business. Events will open a case in the Customer Service portal and the SkyDBA team will investigate the event and work with your team to resolve any issues.
+With a SkyDBA Subscription, our database experts can assist with tasks such as analyzing core dumps, system logs and other similar technical issues that may require deeper focus.
+Work with the SkyDBA team to set up custom backup and restore strategies based on your needs.
+Have the SkyDBA team help you recover data from a backup (or other source) and periodically validate that backups are valid in the event a restore is ever needed. Recovering a backup to a secondary service will require additional compute resource expenditure.
+ + + + + + + + + + + + + +Launch
+https://skysql.mariadb.com/launch-service
+While making launch-time selections, your selections and estimated costs are shown at right.
+If you require AWS PrivateLink or Google Private Service Connect, pleaseĀ Contact Support.
+To launch a SkySQL service from theĀ Portal:
+After initiating service launch, the service will be shown on theĀ PortalĀ Dashboard.
+AĀ notificationĀ will be sent at time of service launch initiation and when service launch completes.
+ + + + + + + + + + + + + +SkySQL's self-service management features enable authorized accounts to launch cloud databases, start and stop cloud databases, delete cloud databases, apply database configuration changes, and configure the cloud database's IP firewall.
+Self-serviceĀ user managementĀ features enable you to define role-based access for your team to jointly manage SkySQL resources.
+Service - Stop
+https://app.skysql.com/dashboard
+To stop a service:
+The service will be stopped. You will only be charged for storage on a stopped service.
+NotificationsĀ will be generated when this operation is initiated and when the operation is performed.
+Service - Start
+https://skysql.mariadb.com/dashboard
+To start a service:
+The service will be started. Service start may take up to 15 minutes. The normal billing cycle for the service will resume.
+NotificationsĀ will be generated when this operation is initiated and when the operation is performed.
+Service - Horizontal Scaling
+https://skysql.mariadb.com/dashboard
+Horizontal scaling is performed by scaling nodes In (reducing node count) or Out (increasing node count).
+To scale nodes horizontally:
+The service immediately goes into scaling status.
+NotificationsĀ will be generated when this operation is initiated and when the operation is performed.
+Service - Vertical Scaling
+https://skysql.mariadb.com/dashboard
+Vertical scaling is performed by scaling nodes Up (increasing node size) or Down (decreasing node size).
+To scale nodes vertically:
+The service immediately goes into scaling status.
+NotificationsĀ will be generated when this operation is initiated and when the operation is performed.
+Service - Scale Storage
+https://skysql.mariadb.com/dashboard
+To expand block storage capacity:
+Storage scaling is subject to a 6 hour cooldown period.
+Storage upgrades are not reversible.
+Service - Delete
+https://skysql.mariadb.com/dashboard
+To delete a service:
+Your service and all its data will be deleted. This operation is non-reversible.
+NotificationsĀ will be generated when this operation is initiated and when the operation is performed.
+Actions performed through the Portal will generate a notification.
+One notification is generated when an action is initiated.
+Additional notifications are generated to convey status as the action is carried out by the system.
+To access current notifications:
+A menu of recent notifications will be displayed.
+The bell icon will include a red dot indicator when a new notification is present. This indicator can be cleared by clicking the "Clear all" link.
+ +Notifications
+https://skysql.mariadb.com/dashboard
+To view historical notifications, click the "View more" link at the bottom of the menu. When viewing historical notifications, notifications can be filtered by category and time frame.
+ +Notifications - current and historical
+https://skysql.mariadb.com/notifications
+You can configure the notifications delivered to your email address from User Preferences.
+To access User Preferences:
+From User Preferences you can specify your notification preferences:
+User Preferences
+https://skysql.mariadb.com/user-preferences
+In addition to display in the Portal, notifications can also be delivered by email.
+Notification Channels define who receives what type of notifications.
+To access Notification Channel settings:
+Notification Channels
+https://skysql.mariadb.com/settings/channel
+To add a Notification Channel, from the Notification Channel settings interface:
+Notification Channels - Adding a Channel
+https://skysql.mariadb.com/settings/channel
+To remove a Notification Channel, from the Notification Channel settings interface:
+To modify a Notification Channel, from the Notification Channel settings interface:
+AfterĀ service launch, a detailed summary of the service can be accessed in the Service Details interface.
+Service Details
+https://skysql.mariadb.com/service/DBID/details
+Service details vary based on topology.
+Service details may include:
+The available panels are :
+Should be evaluated as "Panel name(context, UI tab)"
+This panel shows the ratio between the types of SQL statements executed by the service during the selected time interval.
+This panel shows the CPU usage for each ES node during the selected time interval.
+This panel shows the CPU usage for the ES node during the selected time interval.
+This panel shows the queries per second (QPS) executed by the ES node during the selected time interval.
+This panel shows the number of used and aborted connections for each ES node along with the max_connections value.
+This panel shows summarized values for certain replication-related metadata to help determine if any replica ES nodes encountered replication issues during the selected time interval.
+This panel shows average values for certain replication-related metadata to help determine if the replica ES nodes are currently lagging behind the primary ES node.
+This panel shows the amount of storage space used (as the usage percentage, actual size, and total size) by each ES node.
+This panel shows the amount of storage space used by the ES node during the selected time interval.
+This panel shows the amount of storage space used by all ES nodes during the selected time interval.
+This panel shows the Global Transaction ID (GTID) for each ES node during the selected time interval.
+This panel shows the average number of seconds that the replica ES nodes lagged behind the primary ES node during the selected time interval.
+This panel shows the current binary log position of the replica SQL thread for each ES node during the selected time interval.
+This panel shows the current binary log position of the replica I/O thread for each ES node during the selected time interval.
+This panel shows the number of slow queries executed by all ES nodes during the selected time interval.
+This panel shows the top 30 statement types that were most frequently executed by all ES nodes during the selected time interval.
+This panel shows the top 30 statement types that were most frequently executed by the ES node during the selected time interval.
+This panel shows the top 30 statement types that were most frequently executed by all ES and Xpand nodes in 1 hour intervals over the past 24 hours.
+This panel shows the number of queries per second (QPS) executed by all ES nodes during the selected time interval.
+This panel shows the number of slow queries executed by all ES nodes during the selected time interval.
+This panel shows the number of client threads running on all ES nodes during the selected time interval.
+This panel shows the number of client threads connected and running on the ES node during the selected time interval.
+This panel shows the number of clients connected to all MaxScale nodes during the selected time interval.
+This panel shows the number of client connections open between the MaxScale node and each ES node during the selected time interval.
+This panel shows the number of connections aborted by the ES node during the selected time interval.
+This panel shows the number of table locks requested by all ES nodes during the selected time interval.
+This panel shows the number of table locks requested by the ES node during the selected time interval.
+This panel shows the number of tables opened by the database servers on all ES nodes during the selected time interval.
+This panel shows the number of tables opened by the database server on the ES node during the selected time interval.
+This panel shows the number of tables that have been opened by all ES nodes during the selected time interval.
+This panel shows memory usage details for all ES nodes during the selected time interval.
+This panel shows the amount of storage space used by all ES nodes during the selected time interval.
+This panel shows the total number of bytes read from the ES node's file system during the selected time interval.
+This panel shows the total number of bytes written to the ES node's file system during the selected time interval.
+This panel shows the total number of bytes written to or read from the ES node's file system during the selected time interval.
+This panel shows the number of input/output operations per second performed by the ES node during the selected time interval.
+This panel shows the total number of reads performed from the ES node's file system during the selected time interval.
+This panel shows the total number of writes performed from the ES node's file system during the selected time interval.
+This panel shows the amount of data received over the network by the operating systems on all ES nodes during the selected time interval.
+This panel shows the amount of data sent over the network by the operating systems on all ES nodes during the selected time interval.
+This panel shows the amount of data sent and received over the network by the database servers on all ES nodes during the selected time interval.
+This panel shows the amount of data sent and received over the network by the database server on the ES node during the selected time interval.
+This panel shows the amount of data sent and received over the network by the operating system on the ES node during the selected time interval.
+This panel shows the amount of data sent and received over the network per hour by the database servers on all ES nodes over the past 24 hours.
+This panel shows the amount of data sent and received over the network per hour by the database server on the ES node over the past 24 hours.
+This panel shows the number of network errors encountered by all ES nodes during the selected time interval.
+This panel shows the number of network errors encountered by the ES node during the selected time interval.
+This panel shows the number of network packets dropped by all ES nodes during the selected time interval.
+This panel shows the number of network packets dropped by the ES node during the selected time interval.
+This panel shows the current CPU usage for the ES or Xpand node.
+This panel shows the current memory usage details for the ES or Xpand node.
+This panel shows memory usage details for the ES or Xpand node during the selected time interval.
+This panel shows the current size of the InnoDB buffer pool for the ES node in two units: the absolute size and the percentage of the server's usable memory.
+This panel shows the current number of client connections as a percentage of the ES node's max_connections value.
+This panel shows the number of bytes per second read and written by InnoDB during the selected time interval.
+This panel shows the total number of rows written and read per second by the ES node during the selected time interval.
+This panel shows the number of client connections to the ES node during the selected time interval.
+This panel shows the number of files opened per second by the database server on the ES node during the selected time interval.
+This panel shows the number of files opened by the database server on the ES node during the selected time interval.
+This panel shows the number of temporary tables created by the ES node during the selected time interval.
+This panel shows the number of threads created and cached for re-use on the ES node during the selected time interval.
+This panel shows the activity of the table open cache on the ES node during the selected time interval.
+This panel shows how many table definitions were cached by the ES node during the selected time interval.
+This panel shows memory usage details for the ES node during the selected time interval.
+This panel shows how much memory the ES node used for the InnoDB buffer pool, InnoDB log buffer, MyISAM key buffer, and query cache during the selected time interval.
+This panel shows memory usage details for the MaxScale node during the selected time interval.
+This panel shows the number of read and write operations per second that were handled by the threads on the MaxScale node during the selected time interval.
+This panel shows the number of threads currently used by the MaxScale node.
+This panel lists the modules installed on the MaxScale node.
+This panel shows the number of client connections closed by the MaxScale node during the selected time interval.
+This panel shows the total event queue length for all threads on the MaxScale node during the selected time interval.
+This panel shows the number of descriptors used by the MaxScale node during the selected time interval.
+This panel shows the longest time the MaxScale node waited for an I/O event during the selected time interval.
+This panel shows the number of clients connected to the MaxScale node during the selected time interval.
+This panel shows the number of database server connections open between the MaxScale node and each ES or Xpand node during the selected time interval.
+This panel shows the current resident set size (RSS) of the MaxScale process.
+This panel shows the current stack size of the MaxScale node.
+ + + + + + + + + + + + + +From the SkySQL Portal, you can launch, query, monitor, and manage your SkySQL services.
+You can access the Portal here
+From the Dashboard, you can see a list of your SkySQL services and status information for each service.
+From a different view, the Dashboard can be accessed by clicking the "Dashboard" link in the main menu (left navigation in the Portal).
+To launch a new service, click the "+ Launch New Service" button on the Dashboard.
+See "Service Launch" for details on the service launch process and launch-time selections.
+Service-specific interfaces are available from the Dashboard by clicking on the service name for the desired service.
+Service-specific interfaces will vary by topology.
+Service-specific interfaces are provided to:
+From the Dashboard, the details needed to connect to your SkySQL service can be seen by clicking on the "CONNECT" button for the desired service.
+See "Client Connections" for details on how to connect to a service.
+From the Dashboard, the "MANAGE" button for a service provides access to:
+The Dashboard includes a Spending gauge to indicate current charges. More detailed billing information can be accessed by clicking on the Spending gauge.
+Alternatively, you can access detailed billing and invoice information by clicking on your name in the upper-right corner of the interface, then select "Billing" from the menu.
+See "Billing" for additional details.
+The Dashboard includes monitoring gauges for Current SQL Commands, CPU Load, and QPS (Queries Per Second). More detailed monitoring can be accessed by clicking on one of these gauges.
+Alternatively, you can access detailed server and service monitoring by clicking on the service name from the Dashboard, then accessing the Monitoring tab (the default view).
+See "Monitoring" for additional details.
+The Dashboard includes the count of active monitoring alerts for your service. More detailed alert information can be accessed by clicking on the Alerts gauge.
+Alternatively, you can access monitoring alerts by clicking the "Alerts" link in the main menu (left navigation in the Portal).
+See "Alerts" for additional details.
+Server log files can be accessed by clicking the "Logs" link in the main menu (left navigation in the Portal).
+See "Logs" for additional details.
+From the Portal, you can connect to and query your SkySQL databases.
+These features can be accessed by clicking the "Workspace" link in the main menu (left navigation in the Portal):
+These settings can be accessed by clicking the "Settings" link in the main menu (left navigation in the Portal):
+Actions performed through the Portal will generate a notification.
+To view current notifications, click the bell icon in the upper-right corner of the interface.
+See "Notifications" for additional details.
+To customize your email notification preferences, click your name in the upper-right corner of the interface, then choose "User preferences".
+See "Notifications" for additional details.
+To log out from SkySQL, click your name in the upper-right corner of the interface, then choose "Logout" from the menu.
+Note
+š” TODO - most of these features are described elsewhere. To be removed later.
+https://mariadb.com/docs/skysql-previous-release/service-management/options/aws-privatelink/ | +Connects your AWS VPC network to MariaDB SkySQL with connectivity over Amazon's network | +
---|---|
https://mariadb.com/docs/skysql-previous-release/service-management/options/cross-region-replicas/ | +For disaster recovery, data is replicated to a different supported region | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/custom-configuration/ | +Changes the default service design and configuration | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/custom-instance-sizes/ | +Changes the available instance sizes | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/database-account-2fa/ | +Enables two-factor authentication (2FA) for database user accounts | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/database-account-ldap/ | +Enables LDAP authentication for database user accounts | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/disable-ssltls/ | +Disables default data-in-transit encryption; typically paired with AWS PrivateLink or GCP VPC Peering | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/maxscale-redundancy/ | +Enables highly available (HA) active-active load balancers and ability to choose load balancer instance size | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/point-in-time-recovery/ | +Configures additional retention of binary logs to enable point-in-time recovery at a later date | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/replication/ | +Inbound (to MariaDB SkySQL) and outbound (from MariaDB SkySQL) replication | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/single-zone-deployment/ | +Reduced latency for Distributed Transactions | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/skysql-portal-sso/ | +Authenticate to SkySQL Portal using SAML 2.0 IDP | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/skysql-teams/ | +Multiple SkySQL user accounts jointly maintain services under a single billing profile | +
https://mariadb.com/docs/skysql-previous-release/service-management/options/vpc-peering/ | +Connects your GCP VPC network to MariaDB SkySQL with connectivity over Google's network | +
This walkthrough explains how to launch database services and manage the lifecycle of database services using the SkySQL DBaaS REST API.
+SkySQLĀ API:Ā Databases
.Set theĀ SKYSQL_API_KEY
Ā environment variable to the new API key value:
$ export SKYSQL_API_KEY='... key data ...'
+
TheĀ SKYSQL_API_KEY
Ā environment variable will be used in the subsequent steps.
Note
+You can use the Swagger docs site we host we try out the API OR +Follow the instructions below to try the API using your command Shell
+You can use the API Documentation here and directly try out the APIs in your browser.
+All you need is to click āAuthorizeā and type in Bearer <supply your API key here>
Note
+** Pre-requisites for code below **
+The examples below useĀ curlĀ as the REST client.Ā curlĀ is available for Linux, macOS, and MS Windows. Of course, you can use any language client that supports invoking REST over HTTP. +Examples below also use jq, a JSON parsing utility.Ā jqĀ is available for Linux, macOS, and MS Windows. Install jq then proceed.
+The examples also make use ofĀ teeĀ to save the response JSON data to a file while also allowing it to be piped toĀ jqĀ for output. Both Linux and macOS supportĀ teeĀ as described in the examples. On MS Windows, Powershell has aĀ teeĀ command that requires theĀ -filepathĀ option to be inserted prior to the filename.
+TheĀ chmodĀ command is used to make a file private to the current user. If your environment doesn't supportĀ chmod, you can set the file's permissions using other means.
+The examples also make use of exported variables andĀ ${VARIABLE_NAME}Ā variable references that are compatible with Bourne-like shells (such asĀ sh,Ā bash, andĀ zsh). On MS Windows, you will need to adapt these instructions if you are not using a Bourne-like shell. For example, you can copy just theĀ jqĀ part of an export command (from inside the backticks), run that on its own, and then copy/paste the resulting string into a variable assignment for your shell.
+Finally, the examples use a backslash at the end of some of the lines to indicate to the shell that a command spans multiple lines. If your shell doesn't allow this, remove each trailing backslash character and join the following line to the end of the current line.
+When your new service is created, your client can only connect through the service's firewall if the client IP address is in the service's IP allowlist.
+Before creating the new service, determine the public IP address of your client host and save it to theĀ SKYSQL_CLIENT_IP
Ā environment variable.
If you are not sure of your public IP address, you can use a lookup service, such asĀ checkip.amazonaws.com
:
$ export SKYSQL_CLIENT_IP=`curl -sS checkip.amazonaws.com`
+
To launch a service:
+request-service.json
:cat > request-service.json <<EOF
+{
+ "service_type": "transactional",
+ "topology": "es-single",
+ "provider": "gcp",
+ "region": "us-central1",
+ "architecture": "amd64",
+ "size": "sky-2x8",
+ "storage": 100,
+ "nodes": 1,
+ "name": "skysql-quickstart",
+ "ssl_enabled": true,
+ "allow_list": [
+ {
+ "comment": "Describe the IP address",
+ "ip": "${SKYSQL_CLIENT_IP}/32"
+ }
+ ]
+}
+EOF
+
This configuration is suitable for a quick test, but a more customized configuration should be selected for performance testing or for alignment to the needs of production workloads:
+service_type
, choose aĀ Service Type Selectiontopology
, choose aĀ Topology Selectionprovider
, choose aĀ Cloud Provider SelectionĀ (aws
Ā orĀ gcp
)region
, choose aĀ Region Selectionarchitecture
, choose aĀ Hardware Architecture Selectionsize
, choose anĀ Instance Size Selectionstorage
, choose aĀ Transactional Storage Size Selectionnodes
, choose aĀ Node Count Selectionversion
, choose theĀ Software Version Selectionname
, choose aĀ Service NameĀ for the new serviceForĀ allow_list
, set the client IP address using CIDR notation, so that the client can connect through theĀ Firewall
Provide the request to theĀ [/provisioning/v1/services
Ā API endpoint](https://mariadb.com/docs/skysql-dbaas/ref/skynr/api/slash_provisioning_slash_v1_slash_services,POST/)Ā to create (launch) a new database service and save the response to theĀ response-service.json
Ā file:
curl -sS --location --request POST \
+ --header "Authorization: Bearer ${SKYSQL_API_KEY}" \
+ --header "Accept: application/json" \
+ --header "Content-type: application/json" \
+ --data '@request-service.json' \
+ https://api.skysql.com/provisioning/v1/services \
+ | tee response-service.json | jq .
+
Upon success, the command will return JSON with details about the new service.
+Read the service ID for the new service and save the value in theĀ SKYSQL_SERVICE
Ā environment variable:
$ export SKYSQL_SERVICE=`jq -r .id response-service.json`
+
Before advancing, check the service state using theĀ [/provisioning/v1/services/${SKYSQL_SERVICE}
Ā API endpoint](https://mariadb.com/docs/skysql-dbaas/ref/skynr/api/slash_provisioning_slash_v1_slash_services_slash_ocb_service_id_ccb_,GET/):
curl -sS --location --request GET \
+ --header "Authorization: Bearer ${SKYSQL_API_KEY}" \
+ --header "Accept: application/json" \
+ https://api.skysql.com/provisioning/v1/services/${SKYSQL_SERVICE} \
+ | tee response-state.json | jq .status
+
When the service is still being launched, the JSON payload will containĀ "pending_create"
Ā orĀ "pending_modifying"
Ā as the service status.
When the service has been launched, the JSON payload containsĀ "ready"
, and you can continue with the next steps. Keep in mind that some of the following values will not be populated in the JSON data until this ready status has been achieved.
Obtain the connection credentials for the new SkySQL service by executing the following commands:
+IfĀ ssl_enabled
Ā isĀ true
Ā on your service (the default), downloadĀ [skysql_chain_2022.pem](https://supplychain.mariadb.com/skysql/skysql_chain_2022.pem)
, which contains the Certificate Authority chain that is used to verify the server's certificate for TLS:
$ curl https://supplychain.mariadb.com/skysql/skysql_chain_2022.pem --output ~/Downloads/skysql_chain_2022.pem
+
Obtain the hostname and port of the service and save them to theĀ SKYSQL_FQDN
Ā andĀ SKYSQL_PORT
Ā environment variables:
The hostname is specified with theĀ "fqdn"
Ā key.
$ export SKYSQL_FQDN=`jq -r .fqdn response-state.json`
+
Available TCP ports are specified in theĀ "endpoints"
Ā array. For this test, connect to theĀ "port"
Ā whereĀ "name"
Ā isĀ "readwrite"
.
$ export SKYSQL_PORT=`jq '.endpoints[0].ports[] | select(.name=="readwrite") | .port' response-state.json`
+
Obtain the default username and password for the service using theĀ [/provisioning/v1/services/${SKYSQL_SERVICE}/security/credentials
Ā API endpoint](https://mariadb.com/docs/skysql-dbaas/ref/skynr/api/slash_provisioning_slash_v1_slash_services_slash_ocb_service_id_ccb_slash_security_slash_credentials/)Ā and save the response to theĀ response-credentials.json
Ā file:
curl -sS --location --request GET \
+ --header "Authorization: Bearer ${SKYSQL_API_KEY}" \
+ --header "Accept: application/json" \
+ --header "Content-type: application/json" \
+ https://api.skysql.com/provisioning/v1/services/${SKYSQL_SERVICE}/security/credentials \
+ | tee response-credentials.json | jq .
+
The default username and password will not be available until the service state isĀ "ready"
.
Set the file's mode to only allow the current user to read its contents:
+$ chmod 600 response-credentials.json
+
Read the username and password fromĀ response-credentials.json
Ā and save them to theĀ SKYSQL_USERNAME
Ā andĀ SKYSQL_PASSWORD
Ā environment variables:
$ export SKYSQL_USERNAME=`jq -r .username response-credentials.json`
+$ export SKYSQL_PASSWORD=`jq -r .password response-credentials.json`
+
Connect to the database using the host, port, and default credentials using theĀ [mariadb
Ā client](https://mariadb.com/docs/skysql-dbaas/ref/mdb/cli/mariadb/):
mariadb --host ${SKYSQL_FQDN} --port ${SKYSQL_PORT} \
+ --user ${SKYSQL_USERNAME} --password="${SKYSQL_PASSWORD}" \
+ --ssl-ca ~/Downloads/skysql_chain_2022.pem
+
If you don't want the password to appear on the command-line, specify theĀ [--password
Ā command-line option](https://mariadb.com/docs/skysql-dbaas/ref/mdb/cli/mariadb/password/)Ā without an argument to be prompted for a password.
To connect to your SkySQL service easily, it is possible to create aĀ .my.cnf
Ā file in your home directory that contains all the details of your connection.
.my.cnf
Ā file or overwrite an existing one and populates it with the connection information that was collected in the previous steps:cat > ~/.my.cnf <<EOF
+[client]
+host=${SKYSQL_FQDN}
+port=${SKYSQL_PORT}
+user=${SKYSQL_USERNAME}
+password="${SKYSQL_PASSWORD}"
+ssl-ca=${HOME}/Downloads/skysql_chain_2022.pem
+EOF
+
Set the file system permissions for theĀ .my.cnf
Ā file to ensure that other users can't read it:
$ chmod 600 ~/.my.cnf
+
When all the connection parameters are in yourĀ ~/.my.cnf
Ā file, theĀ [mariadb
Ā client](https://mariadb.com/docs/skysql-dbaas/ref/mdb/cli/mariadb/)Ā can connect without specifying any command-line options:
$ mariadb
+
This walkthrough explains how to launch database services and manage the lifecycle of database services using the Terraform provider.
+For users who prefer other interfaces, SkySQL offers the following alternatives:
+ +This walkthrough demonstrates a service configuration that is suitable for a quick test. A more customized configuration should be selected for performance testing or for alignment to the needs of production workloads.
+Note
+This procedure uses Terraform. HashiCorp officially supports Terraform on several Linux distributions, but HashiCorp also provides binaries for Microsoft Windows, macOS, and other operating systems.
+For a list of operating systems that are officially supported for Terraform, see "HashiCorp Terraform Documentation: Supported Operating Systems".
+For a list of operating systems that have binaries available for Terraform, see "HashiCorp Terraform Documentation: Install Terraform".
+jq
, a JSON parsing utility.Ā jqĀ is available for Linux, macOS, and MS Windows. InstallĀ jq
Ā then proceed.curl
, a data transfer utility.Ā curlĀ is available for Linux, macOS, and MS Windows. InstallĀ curl
Ā then proceed.wget
, a file download utility.Ā GNU WgetĀ is available for Linux, macOS, and MS Windows. InstallĀ wget
Ā then proceed.sh
,Ā bash
, andĀ zsh
).SkySQLĀ API:Ā Databases
.Create a directory for your Terraform project and change to the directory:
+$ mkdir -p ~/skysql-nr-tf
+$ cd ~/skysql-nr-tf
main.tf
In the Terraform project directory, create aĀ main.tf
Ā file that contains the following:
# ---------------------
+# Provider Requirements
+# ---------------------
+# TF Documentation: https://developer.hashicorp.com/terraform/language/providers/requirements
+
+terraform {
+ required_providers {
+ skysql = {
+ source = "registry.terraform.io/mariadb-corporation/skysql"
+ }
+ }
+}
+
+# ----------------------
+# Provider Configuration
+# ----------------------
+# TF Documentation: https://developer.hashicorp.com/terraform/language/providers/configuration
+
+provider "skysql" {
+ access_token = var.api_key
+}
+
+# ---------
+# Resources
+# ---------
+# TF Documentation: https://developer.hashicorp.com/terraform/language/resources/syntax
+
+# Create a service
+resource "skysql_service" "default" {
+ service_type = var.service_type
+ topology = var.topology
+ cloud_provider = var.cloud_provider
+ region = var.region
+ availability_zone = coalesce(var.availability_zones, data.skysql_availability_zones.default.zones[0].name)
+ architecture = var.architecture
+ size = var.size
+ storage = var.storage
+ nodes = var.nodes
+ version = coalesce(var.sw_version, data.skysql_versions.default.versions[0].name)
+ name = var.name
+ ssl_enabled = var.ssl_enabled
+ deletion_protection = var.deletion_protection
+ wait_for_creation = true
+ wait_for_deletion = true
+ wait_for_update = true
+ is_active = true
+ allow_list = [
+ {
+ "ip" : var.ip_address,
+ "comment" : var.ip_address_comment
+ }
+ ]
+}
+
+# ------------
+# Data Sources
+# ------------
+# TF Documentation: https://developer.hashicorp.com/terraform/language/data-sources
+
+# Retrieve the list of projects. Projects are a way to group services.
+data "skysql_projects" "default" {}
+
+# Retrieve the list of available versions for a specific topology
+data "skysql_versions" "default" {
+ topology = var.topology
+}
+
+# Retrieve the service details
+data "skysql_service" "default" {
+ service_id = skysql_service.default.id
+}
+
+# Retrieve the service default credentials.
+# When the service is created please change the default credentials
+data "skysql_credentials" "default" {
+ service_id = skysql_service.default.id
+}
+
+data "skysql_availability_zones" "default" {
+ region = var.region
+ filter_by_provider = var.cloud_provider
+}
+
outputs.tf
In the Terraform project directory, create anĀ outputs.tf
Ā file that contains theĀ output valuesĀ used to display metadata about the SkySQL service:
# -------------
+# Output Values
+# -------------
+# TF Documentation: https://developer.hashicorp.com/terraform/language/values/outputs
+
+output "skysql_projects" {
+ value = data.skysql_projects.default
+}
+
+# Show the service details
+output "skysql_service" {
+ value = data.skysql_service.default
+}
+
+# Show the service credentials
+output "skysql_credentials" {
+ value = data.skysql_credentials.default
+ sensitive = true
+}
+
+# Example how you can generate a command line for the database connection
+output "skysql_cmd" {
+ value = "mariadb --host ${data.skysql_service.default.fqdn} --port 3306 --user ${data.skysql_service.default.service_id} -p --ssl-ca ~/Downloads/skysql_chain_2022.pem"
+}
+
+output "availability_zones" {
+ value = data.skysql_availability_zones.default
+}
+
variables.tf
In the Terraform project directory, create aĀ variables.tf
Ā file that contains theĀ input variablesĀ used to configure the SkySQL service:
# ---------------
+# Input Variables
+# ---------------
+# TF Documentation: https://developer.hashicorp.com/terraform/language/values/variables
+
+variable "api_key" {
+ type = string
+ sensitive = true
+ description = "The SkySQL API Key generated at: https://id.mariadb.com/account/api/generate-key"
+}
+
+variable "service_type" {
+ type = string
+ default = "transactional"
+ description = "Specify \"transactional\" or \"analytical\". For additional information, see: https://mariadb.com/docs/skysql/ref/skynr/selections/service-types/"
+}
+
+variable "topology" {
+ type = string
+ default = "es-single"
+ description = "Specify a topology. For additional information, see: https://mariadb.com/docs/skysql/ref/skynr/selections/topologies/"
+}
+
+variable "cloud_provider" {
+ type = string
+ default = "gcp"
+ description = "Specify the cloud provider. For additional information, see: https://mariadb.com/docs/skysql/ref/skynr/selections/providers/"
+}
+
+variable "region" {
+ type = string
+ default = "us-central1"
+ description = "Specify the region. For additional information, see: https://mariadb.com/docs/skysql/ref/skynr/selections/regions/"
+}
+
+variable "availability_zone" {
+ type = string
+ default = null
+ description = "Specify the availability zone for the cloud provider and region. For additional information, see: https://mariadb.com/docs/skysql/ref/skynr/selections/availability-zones/"
+}
+
+variable "architecture" {
+ type = string
+ default = "amd64"
+ description = "Specify a hardware architecture. For additional information, see: https://mariadb.com/docs/skysql/ref/skynr/selections/architectures/"
+}
+
+variable "size" {
+ type = string
+ default = "sky-2x8"
+ description = "Specify the database node instance size. For additional information, see: https://mariadb.com/docs/skysql/ref/skynr/selections/instance-sizes/"
+}
+
+variable "storage" {
+ type = number
+ default = 100
+ description = "Specify a transactional storage size. For additional information, see: https://mariadb.com/docs/skysql/ref/skynr/selections/storage-sizes/"
+}
+
+variable "nodes" {
+ type = number
+ default = 1
+ description = "Specify a node count. For additional information, see: https://mariadb.com/docs/skysql/ref/skynr/selections/node-count/"
+}
+
+variable "sw_version" {
+ type = string
+ default = null
+ description = "Specify a software version. For additional information, see: https://mariadb.com/docs/skysql/ref/skynr/selections/versions/"
+}
+
+variable "name" {
+ type = string
+ default = "skysql-nr-quickstart"
+ description = "Specify a name for the service. For additional information, see: https://mariadb.com/docs/skysql/selections/nr-launch-time-service-name/"
+}
+
+variable "ssl_enabled" {
+ type = bool
+ default = true
+ description = "Specify whether TLS should be enabled for the service. For additional information, see: https://mariadb.com/docs/skysql/selections/nr-launch-time-disable-ssltls/"
+}
+
+variable "deletion_protection" {
+ type = bool
+ default = true
+ description = "Specify whether the service can be deleted via Terraform (false) or whether trying to do so raises an error (true)"
+}
+
+variable "ip_address" {
+ type = string
+ description = "Specify an IP address in CIDR format to add to the service's IP allowlist. For additional information, see: https://mariadb.com/docs/skysql/security/nr-firewall/"
+}
+
+variable "ip_address_comment" {
+ type = string
+ description = "Specify a comment describing the IP address. For additional information, see: https://mariadb.com/docs/skysql/security/nr-firewall/"
+}
+
The variables are configured in the next step.
+.tfvars
Ā FileAĀ [.tfvars
Ā file](https://developer.hashicorp.com/terraform/tutorials/configuration-language/variables#assign-values-with-a-file)Ā can be used to configure the service using the input variables.
For example:
+api_key = "... key data ..."
+service_type = "transactional"
+topology = "es-single"
+cloud_provider = "gcp"
+region = "us-central1"
+availability_zone = null
+architecture = "amd64"
+size = "sky-2x8"
+storage = 100
+nodes = 1
+sw_version = null
+name = "skysql-nr-quickstart"
+ssl_enabled = true
+deletion_protection = true
+ip_address = "192.0.2.10/32"
+ip_address_comment = "Describe the IP address"
+
The input variables should be customized for your own needs:
+api_key
, set it to the API key previously created in "Step 1: Generate API Key".service_type
, choose aĀ Service Type Selectiontopology
, choose aĀ Topology Selectioncloud_provider
, choose aĀ Cloud Provider Selectionregion
, choose aĀ Region Selectionavailability_zone
, choose aĀ Availability Zone SelectionĀ or leave itĀ null
Ā to use the default availability zone for the cloud provider and regionarchitecture
, choose aĀ Hardware Architecture Selectionsize
, choose anĀ Instance Size Selectionstorage
, choose aĀ Transactional Storage Size Selectionnodes
, choose aĀ Node Count Selectionsw_version
, choose theĀ Software Version SelectionĀ or leave itĀ null
Ā to use the default version for the topologyname
, choose aĀ Service NameĀ for the new servicedeletion_protection
, choose whether the service can be deleted via Terraform (false
) or whether trying to do so raises an error (true
)ip_address
, choose an IP address to allow through theĀ Firewallip_address_comment
, provide a description for the IP addressThe following steps assume that the file is calledĀ skysql-nr-quickstart.tfvars
.
terraformĀ init
Initialize the Terraform project directory and download the Terraform provider from theĀ Terraform RegistryĀ by executing theĀ [terraformĀ init
Ā command](https://developer.hashicorp.com/terraform/cli/commands/init):
$ terraform init
If you need to download the provider manually, see "Manually Install Provider from Binary Distribution".
+terraformĀ plan
Create a Terraform execution plan by executing theĀ [terraformĀ plan
Ā command](https://developer.hashicorp.com/terraform/cli/commands/plan)Ā and specifying the path to theĀ .tfvars
Ā file:
$ terraform plan -var-file="skysql-nr-quickstart.tfvars"
terraformĀ apply
Execute the Terraform execution plan and create the SkySQL service by executing theĀ [terraformĀ apply
Ā command](https://developer.hashicorp.com/terraform/cli/commands/apply)Ā and specifying the path to theĀ .tfvars
Ā file:
$ terraform apply -var-file="skysql-nr-quickstart.tfvars"
Terraform prints the plan from the previous step again and prompts the user to confirm that the plan should be applied:
+Do you want to perform these actions?
+ Terraform will perform the actions described above.
+ Only 'yes' will be accepted to approve.
+
+ Enter a value: yes
+
Then Terraform creates the objects and prints status messages:
+skysql_service.default: Creating...
+skysql_service.default: Still creating... [10s elapsed]
+skysql_service.default: Still creating... [20s elapsed]
+skysql_service.default: Still creating... [30s elapsed]
+skysql_service.default: Still creating... [40s elapsed]
+skysql_service.default: Still creating... [50s elapsed]
+skysql_service.default: Still creating... [1m0s elapsed]
+skysql_service.default: Still creating... [1m10s elapsed]
+skysql_service.default: Still creating... [1m20s elapsed]
+skysql_service.default: Still creating... [1m30s elapsed]
+skysql_service.default: Still creating... [1m40s elapsed]
+skysql_service.default: Still creating... [1m50s elapsed]
+skysql_service.default: Still creating... [2m0s elapsed]
+skysql_service.default: Still creating... [2m10s elapsed]
+skysql_service.default: Still creating... [2m20s elapsed]
+skysql_service.default: Still creating... [2m30s elapsed]
+skysql_service.default: Still creating... [2m40s elapsed]
+skysql_service.default: Still creating... [2m50s elapsed]
+skysql_service.default: Still creating... [3m0s elapsed]
+skysql_service.default: Still creating... [3m10s elapsed]
+skysql_service.default: Still creating... [3m20s elapsed]
+skysql_service.default: Still creating... [3m30s elapsed]
+skysql_service.default: Creation complete after 3m40s [id=dbpgf00000001]
+data.skysql_credentials.default: Reading...
+data.skysql_service.default: Reading...
+data.skysql_service.default: Read complete after 0s [name=skysql-nr-quickstart]
+data.skysql_credentials.default: Read complete after 0s
+
+Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
+
Then Terraform prints the outputs.
+Obtain the connection credentials for the new SkySQL service by executing the following commands:
+DownloadĀ [skysql_chain_2022.pem](https://supplychain.mariadb.com/skysql/skysql_chain_2022.pem)
, which contains the Certificate Authority chain that is used to verify the server's certificate for TLS:
$ curl https://supplychain.mariadb.com/skysql/skysql_chain_2022.pem --output ~/Downloads/skysql_chain_2022.pem
Obtain the connection command from theĀ terraform.tfstate
Ā file:
$ jq ".outputs.skysql_cmd" terraform.tfstate
"mariadb --host dbpgf00000001.sysp0000.db.skysql.net --port 3306 --user dbpgf00000001 -p --ssl-ca ~/Downloads/skysql_chain_2022.pem"
Obtain the user password from theĀ terraform.tfstate
Ā file:
$ jq ".outputs.skysql_credentials.value.password" terraform.tfstate
"..password string.."
Connect to the SkySQL service by executing the connection command from the previous step:
+$ mariadb --host dbpgf00000001.sysp0000.db.skysql.net --port 3306 --user dbpgf00000001 -p --ssl-ca ~/Downloads/skysql_chain_2022.pem
When prompted, type the password and press enter to connect:
+Enter password:
+Welcome to the MariaDB monitor. Commands end with ; or \g.
+Your MariaDB connection id is 1059
+Server version: 10.6.11-6-MariaDB-enterprise-log MariaDB Enterprise Server
+
+Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
+
+Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
+
+MariaDB [(none)]>
+
terraformĀ destroy
Delete the service by executing theĀ [terraformĀ destroy
Ā command](https://developer.hashicorp.com/terraform/cli/commands/destroy)Ā and specifying the path to theĀ .tfvars
Ā file:
$ terraform destroy -var-file="skysql-nr-quickstart.tfvars"
Terraform prints the plan to delete the service and prompts the user to confirm that the plan should be applied:
+`Do you really want to destroy all resources? + Terraform will destroy all your managed infrastructure, as shown above. + There is no undo. Only 'yes' will be accepted to confirm.
+Enter a value: yes`
+If deletion protection is enabled for the resources, the operation raises an error:
+ā·
+ā Error: Can not delete service
+ā
+ā Deletion protection is enabled
+āµ
If deletion protection is not enabled for the resources, Terraform deletes the resources and prints status messages:
+skysql_service.default: Destroying... [id=dbpgf00000001]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 10s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 20s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 30s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 40s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 50s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 1m0s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 1m10s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 1m20s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 1m30s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 1m40s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 1m50s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 2m0s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 2m10s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 2m20s elapsed]
+skysql_service.default: Still destroying... [id=dbpgf00000001, 2m30s elapsed]
+skysql_service.default: Destruction complete after 2m38s
+
+Destroy complete! Resources: 1 destroyed.
+
The SkySQL New Release Terraform provider can be downloaded from theĀ GitHub releases pageĀ as a binary distribution and manually installed.
+WithĀ Linux, manually install the provider on the target system by performing the following steps in the same Bash terminal:
+Set some environment variables to configure your provider version, OS, and architecture:
+$ export TF_PROVIDER_RELEASE=1.1.0
+$ export TF_PROVIDER_OS=linux
+$ export TF_PROVIDER_ARCH=amd64
ForĀ TF_PROVIDER_ARCH
, the following architectures are supported on Linux:
386
amd64
arm
arm64
wget
:$ wget -q https://github.com/mariadb-corporation/terraform-provider-skysql/releases/download/v1.1.0/terraform-provider-skysql_${TF_PROVIDER_RELEASE}_${TF_PROVIDER_OS}_${TF_PROVIDER_ARCH}.zip
Create a Terraform plugin directory:
+$ mkdir -p ~/.terraform.d/plugins/registry.terraform.io/mariadb-corporation/skysql
Move the provider's binary distribution to the Terraform plugin directory:
+$ mv terraform-provider-skysql_${TF_PROVIDER_RELEASE}_${TF_PROVIDER_OS}_${TF_PROVIDER_ARCH}.zip ~/.terraform.d/plugins/registry.terraform.io/mariadb-corporation/skysql/
Verify that the provider's binary distribution is present in the Terraform plugin directory:
+$ ls -l ~/.terraform.d/plugins/registry.terraform.io/mariadb-corporation/skysql/
WithĀ macOS, manually install the provider on the target system by performing the following steps in the same macOS Terminal:
+IfĀ HomebrewĀ is not installed, install it:
+$ /bin/bash -c "**$(**curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh**)**"
InstallĀ wget
Ā using Homebrew:
$ brew install wget
Set some environment variables to configure your provider version, OS, and architecture:
+$ export TF_PROVIDER_RELEASE=1.1.0
+$ export TF_PROVIDER_OS=darwin
+$ export TF_PROVIDER_ARCH=arm64
ForĀ TF_PROVIDER_ARCH
, the following architectures are supported on macOS:
amd64
arm64
wget
:$ wget -q https://github.com/mariadb-corporation/terraform-provider-skysql/releases/download/v1.1.0/terraform-provider-skysql_${TF_PROVIDER_RELEASE}_${TF_PROVIDER_OS}_${TF_PROVIDER_ARCH}.zip
Create a Terraform plugin directory:
+$ mkdir -p ~/.terraform.d/plugins/registry.terraform.io/mariadb-corporation/skysql
Move the provider's binary distribution to the Terraform plugin directory:
+$ mv terraform-provider-skysql_${TF_PROVIDER_RELEASE}_${TF_PROVIDER_OS}_${TF_PROVIDER_ARCH}.zip ~/.terraform.d/plugins/registry.terraform.io/mariadb-corporation/skysql/
Verify that the provider's binary distribution is present in the Terraform plugin directory:
+$ ls -l ~/.terraform.d/plugins/registry.terraform.io/mariadb-corporation/skysql/
RK0$B9j!ftK33~8
zmo-o3EisU)`}B@FzpaSf81Xz;#3~M5nIbSbEQ=A&x5kpw`{rK=h*^2dRd?;5Z65MM
z+cEm++XE98cp3f30G*{t)k6C0^CIzW);5hl!8K8@oDD!i$J&?Hv=
z4@5hYN_bP$Bs-GPI3uP^!3>q; R-K@I;w$EC%bpBcB9RlKuFJVB16-*IN~+yy11
z-_4mxh3lKIK}y=PuH=m8ho*4DKDSR}_*?R?_(uxw2Yl+%V{_=xBV*tnzJlh>#E*0F
ztdG+6u;4fQn0a1#C)W#vOtNiv?4y5?6(v|cOSvqr8RVELiceVy7cU*qGIFe
H4?o56-QU8U;hL;m(;&<0p}c3KOSY
z%%58|P2g`i*x}alb?N*PU$+9}(0+FIU8|q8T;tDDzj1$<9qq
AfI#BA|DBVW$QzLh3?m
zQoTHG`!ME_WaJ%-xprRwvZ3`ZigKiuz?pMy_xIafy=gX}_Q=vtT&Zi6zl)bUK5WR?
zX88-LrRKDNhtXAU)xVx6_P}6!38Y~;k6DhWn$@|i`IN7hGEqs!Dt++3&-c*d2EkpY
zW48Jqr&ly5<4@}|RNb#(efiA9V6+`-xjxRDTEPK(d)sI$B;DY1PQ(+7xvXzIyY=68
zYC|+zzX#T7wY0H$6BkcV6^+@qu+6_l8c(_~AWh!8RZhz1^VpKrRSF+*v}@<$=Q935
zTq1&twO`#drm-fw5VU!|O*ib5dyt+ApTezNbpNY|x`8q$X^%QiA@(q!x3tm${=p
zgof$Y8SjQ@R^hLV&Ann1oNJCNSHxM1pF!-%K|rA;|9Ut3`LV~3E$YriH+5;=ZAZk$
z{QS>vxj35nlI&mnS9izX>cRTL(@&D5d5B$(mRZf_$M%0I8D`@(kT|`{3X#8TfnSI6mL^Rbv~{fgC3O6-n?<Xr=$`7U!+uSD|}U&@p%r+u+1p3*zL
zq}
9EQH|7;}sVF}R{*TtpQ_O4XraPh7b^?-#FaJQL8yzTJjJf&E}(^K!F
z?!=b!%dC3{x!RF$m~GVMRJ%reHcOj{y#BLy!g!L=o0$RE2do>@zCw6)`${*>gYj@P
zU~rum@=QFf4nVc>SG=sMOt>9-c3QacjivKV*2FT2CFFr0Razj6=>&tDQL!AKQs6cX
zsKE182QT=UQbzpdab}=-K4J{w;IJ}H8J8acecae8D@5?q&fX0u9xV6jY7rFIgf<9Q
ziBsa-hCB+MJsPo%C0U1$gJ5}nX`MOCIs}GwOVeC@-1q%JVS}{$bWF%bT;&t577xIU
zlnWg0vh<=Y{=#wS7H`$7hYvSoU+;|WY!}1Pw0(*`Q<3yB?@A8qfX`KMd0$c#!&pZp
zUjqPyTFw4`m+IZCCqvy_5
zqvk`6=coF|r7~fcXM8xL0k!jmcP!=fi?mfO)9nF=1hu_&GMfe4aC#uVOvQoye2
QzLGmtF^DYM(2SlCKrdHe9n75jztOaqy{BeTPF5l=cd1Y!r{!H}
zPv5J1e2bjCtTdxzWB{E+Qsn OphV6hTn
zd4zv*%YjxT-_|3P>{Q#wA&<33gEUMk-3S9?8Y$S`4bvOTiqz_2MM6eUpim(r4F