Skip to main content

mysql

5 configuration options · available in Rust, Python, Node.js, Java

Quick start
use opendal::Operator;

let op = Operator::via_iter("mysql", [
])?;
All configuration options (copy & trim)
Full reference
use opendal::Operator;

let op = Operator::via_iter("mysql", [
// This connection string is used to connect to the mysql service. There are url based formats.
//
// The format of connect string resembles the url format of the mysql client.
// The format is: `[scheme://][user[:[password]]@]host[:port][/schema][?attribute1=value1&attribute2=value2...`
//
// - `mysql://user@localhost`
// - `mysql://user:password@localhost`
// - `mysql://user:password@localhost:3306`
// - `mysql://user:password@localhost:3306/db`
//
// For more information, please refer to <https://docs.rs/sqlx/latest/sqlx/mysql/struct.MySqlConnectOptions.html>.
// ("connection_string".to_string(), "...".to_string()),

// The table name for mysql.
// ("table".to_string(), "...".to_string()),

// The key field name for mysql.
// ("key_field".to_string(), "...".to_string()),

// The value field name for mysql.
// ("value_field".to_string(), "...".to_string()),

// The root for mysql.
// ("root".to_string(), "...".to_string()),

])?;

Every option is passed as a string key; OpenDAL parses it into the right type. Some services may require building the binding with the matching services-* feature enabled.

Configuration reference

General5
KeyTypeRequiredDescription
connection_stringstringnoThis connection string is used to connect to the mysql service. There are url based formats. The format of connect string resembles the url format of the mysql client. The format is: [scheme://][user[:[password]]@]host[:port][/schema][?attribute1=value1&attribute2=value2... - mysql://user@localhost - mysql://user:password@localhost - mysql://user:password@localhost:3306 - mysql://user:password@localhost:3306/db For more information, please refer to <https://docs.rs/sqlx/latest/sqlx/mysql/struct.MySqlConnectOptions.html>.
tablestringnoThe table name for mysql.
key_fieldstringnoThe key field name for mysql.
value_fieldstringnoThe value field name for mysql.
rootstringnoThe root for mysql.