1"use strict";(self.webpackChunkconduit_site=self.webpackChunkconduit_site||[]).push([[4349],{47636:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>x,default:()=>y,frontMatter:()=>u,metadata:()=>s,toc:()=>m});const s=JSON.parse('{"id":"using/connectors/list/mysql","title":"mysql","description":"A Conduit Connector for MySQL","source":"@site/docs/1-using/5-connectors/7-list/40-mysql.mdx","sourceDirName":"1-using/5-connectors/7-list","slug":"/using/connectors/list/mysql","permalink":"/docs/using/connectors/list/mysql","draft":false,"unlisted":false,"editUrl":"https://github.com/conduitio/conduitio.github.io/edit/main/docs/1-using/5-connectors/7-list/40-mysql.mdx","tags":[],"version":"current","lastUpdatedAt":1751449016000,"sidebarPosition":40,"frontMatter":{"IMPORTANT":"This file was generated using src/connectorgen/main.go. DO NOT EDIT.","title":"mysql","description":"A Conduit Connector for MySQL"},"sidebar":"docsSidebar","previous":{"title":"mongo","permalink":"/docs/using/connectors/list/mongo"},"next":{"title":"rabbitmq","permalink":"/docs/using/connectors/list/rabbitmq"}}');var r=t(74848),i=t(28453),o=(t(82514),t(44744)),d=t(96300),c=(t(11470),t(19365),t(43294)),a=t(55281),l=t(9257),h=t(91922);const u={IMPORTANT:"This file was generated using src/connectorgen/main.go. DO NOT EDIT.",title:"mysql",description:"A Conduit Connector for MySQL"},x="mysql",p={},m=[{value:"Latest release",id:"latest-release",level:2},{value:"Description",id:"description",level:2},{value:"Source",id:"source",level:2},{value:"Snapshot mode",id:"snapshot-mode",level:3},{value:"Change Data Capture mode",id:"change-data-capture-mode",level:3},{value:"Unsafe snapshot",id:"unsafe-snapshot",level:3},{value:"Schema",id:"schema",level:3},{value:"Record structure",id:"record-structure",level:3},{value:"Snapshot Records",id:"snapshot-records",level:4},{value:"CDC Records",id:"cdc-records",level:4},{value:"Destination",id:"destination",level:2},{value:"Upsert Behavior",id:"upsert-behavior",level:3},{value:"Requirements and compatibility",id:"requirements-and-compatibility",level:2},{value:"MySQL Server Requirements:",id:"mysql-server-requirements",level:3},{value:"MySQL User Privileges:",id:"mysql-user-privileges",level:3},{value:"Source Parameters",id:"source-parameters",level:2},{value:"Destination Parameters",id:"destination-parameters",level:2}];function j(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"mysql",children:"mysql"})}),"\n",(0,r.jsxs)(d.A,{sx:{display:"flex",alignItems:"center",gap:2,marginBottom:4,borderRadius:1,padding:2,backgroundColor:"rgba(0, 0, 0, 0.03)"},children:[(0,r.jsxs)(d.A,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)("span",{children:"Author: Meroxa, Inc."}),(0,r.jsx)(h.A,{title:"Created by the Conduit team",children:(0,r.jsx)("img",{src:"/img/conduit/conduit-ring.png",width:"18",alt:"Conduit team logo"})})]}),(0,r.jsx)(d.A,{sx:{borderLeft:"1px solid rgba(0, 0, 0, 0.12)",height:24}}),(0,r.jsx)(a.A,{href:"https://github.com/conduitio-labs/conduit-connector-mysql",target:"_blank",sx:{display:"flex",alignItems:"center",gap:.5,color:"inherit",textDecoration:"none","&:hover":{textDecoration:"underline"}},children:(0,r.jsx)(c.A,{sx:{fontSize:"1.5rem"}})}),(0,r.jsx)(o.A,{icon:(0,r.jsx)(l.A,{sx:{fontSize:"1rem"}}),label:"2",size:"small",sx:{height:24}})]}),"\n",(0,r.jsx)(n.h2,{id:"latest-release",children:"Latest release"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://conduit.gateway.scarf.sh/connector/download/conduitio-labs/conduit-connector-mysql/releases/download/v0.2.0/conduit-connector-mysql_0.2.0_Darwin_arm64.tar.gz",children:"conduit-connector-mysql_0.2.0_Darwin_arm64.tar.gz"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://conduit.gateway.scarf.sh/connector/download/conduitio-labs/conduit-connector-mysql/releases/download/v0.2.0/conduit-connector-mysql_0.2.0_Darwin_x86_64.tar.gz",children:"conduit-connector-mysql_0.2.0_Darwin_x86_64.tar.gz"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://conduit.gateway.scarf.sh/connector/download/conduitio-labs/conduit-connector-mysql/releases/download/v0.2.0/conduit-connector-mysql_0.2.0_Linux_arm64.tar.gz",children:"conduit-connector-mysql_0.2.0_Linux_arm64.tar.gz"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://conduit.gateway.scarf.sh/connector/download/conduitio-labs/conduit-connector-mysql/releases/download/v0.2.0/conduit-connector-mysql_0.2.0_Linux_x86_64.tar.gz",children:"conduit-connector-mysql_0.2.0_Linux_x86_64.tar.gz"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://conduit.gateway.scarf.sh/connector/download/conduitio-labs/conduit-connector-mysql/releases/download/v0.2.0/conduit-connector-mysql_0.2.0_Windows_arm64.tar.gz",children:"conduit-connector-mysql_0.2.0_Windows_arm64.tar.gz"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://conduit.gateway.scarf.sh/connector/download/conduitio-labs/conduit-connector-mysql/releases/download/v0.2.0/conduit-connector-mysql_0.2.0_Windows_x86_64.tar.gz",children:"conduit-connector-mysql_0.2.0_Windows_x86_64.tar.gz"})}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"description",children:"Description"}),"\n",(0,r.jsx)(n.h2,{id:"source",children:"Source"}),"\n",(0,r.jsx)(n.p,{children:"A source connector pulls data from an external resource and pushes it to\ndownstream resources via Conduit."}),"\n",(0,r.jsx)(n.h3,{id:"snapshot-mode",children:"Snapshot mode"}),"\n",(0,r.jsx)(n.p,{children:"Snapshot mode is the first stage of the source sync process. It reads all rows\nfrom the configured tables as record snapshots."}),"\n",(0,r.jsxs)(n.p,{children:["In snapshot mode, the record payload consists of\n",(0,r.jsx)(n.a,{href:"https://conduit.io/docs/using/opencdc-record#structured-data",children:"opencdc.StructuredData"}),",\nwith each key being a column and each value being that column's value."]}),"\n",(0,r.jsx)(n.h3,{id:"change-data-capture-mode",children:"Change Data Capture mode"}),"\n",(0,r.jsx)(n.p,{children:"When the connector switches to C
1DC mode, it starts streaming changes from the\nobtained position at the start of the snapshot. It uses the row-based binlog format\nto capture detailed changes at the individual row level."}),"\n",(0,r.jsx)(n.h3,{id:"unsafe-snapshot",children:"Unsafe snapshot"}),"\n",(0,r.jsx)(n.p,{children:"By default, the connector will error out if it finds a table that has no primary key and no specified sorting column specified, as we can't guarantee that the snapshot will be consistent. Table changes during the snapshot will be however captured by CDC mode."}),"\n",(0,r.jsxs)(n.p,{children:["As of writing, the unsafe snapshot is implemented using batches with ",(0,r.jsx)(n.code,{children:"LIMIT"})," and ",(0,r.jsx)(n.code,{children:"OFFSET"}),", so expect it to be slow for large tables. You can optimize the snapshot by specifying a sorting column (see source configuration parameters).\nThe position of the table is currently not recorded, so the unsafe snapshot will restart from zero every time."]}),"\n",(0,r.jsx)(n.h3,{id:"schema",children:"Schema"}),"\n",(0,r.jsxs)(n.p,{children:["The source connector uses ",(0,r.jsx)(n.a,{href:"https://avro.apache.org/docs/1.11.1/specification/",children:"avro"})," to decode mysql rows. Here's the MySQL datatype to avro datatype equivalence that the connector uses:"]}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"MySQL Type"}),(0,r.jsx)(n.th,{children:"Avro Type"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"TINYINT"}),(0,r.jsx)(n.td,{children:"int"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"SMALLINT"}),(0,r.jsx)(n.td,{children:"int"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"MEDIUMINT"}),(0,r.jsx)(n.td,{children:"int"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"INT"}),(0,r.jsx)(n.td,{children:"int"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"BIGINT"}),(0,r.jsx)(n.td,{children:"long"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"DECIMAL"}),(0,r.jsx)(n.td,{children:"double"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"NUMERIC"}),(0,r.jsx)(n.td,{children:"double"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"FLOAT"}),(0,r.jsx)(n.td,{children:"double"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"DOUBLE"}),(0,r.jsx)(n.td,{children:"double"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"BIT"}),(0,r.jsx)(n.td,{children:"bytes"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"CHAR"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"VARCHAR"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"TINYTEXT"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"TEXT"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"MEDIUMTEXT"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"LONGTEXT"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"BINARY"}),(0,r.jsx)(n.td,{children:"bytes"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"VARBINARY"}),(0,r.jsx)(n.td,{children:"bytes"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"TINYBLOB"}),(0,r.jsx)(n.td,{children:"bytes"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"BLOB"}),(0,r.jsx)(n.td,{children:"bytes"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"MEDIUMBLOB"}),(0,r.jsx)(n.td,{children:"bytes"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"LONGBLOB"}),(0,r.jsx)(n.td,{children:"bytes"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"DATE"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"TIME"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"DATETIME"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"TIMESTAMP"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"YEAR"}),(0,r.jsx)(n.td,{children:"long"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"ENUM"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"SET"}),(0,r.jsx)(n.td,{children:"string"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"JSON"}),(0,r.jsx)(n.td,{children:"string"})]})]})]}
1),"\n",(0,r.jsx)(n.h3,{id:"record-structure",children:"Record structure"}),"\n",(0,r.jsxs)(n.p,{children:["Records produced by the MySQL source connector contain the following ",(0,r.jsx)(n.a,{href:"https://conduit.io/docs/using/opencdc-record",children:"opencdc record structure"}),":"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Operation"}),": Indicates the type of change (",(0,r.jsx)(n.code,{children:"create"}),", ",(0,r.jsx)(n.code,{children:"update"}),", ",(0,r.jsx)(n.code,{children:"delete"}),", ",(0,r.jsx)(n.code,{children:"snapshot"}),")."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Payload"}),":","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"Before"}),": (Only present on CDC ",(0,r.jsx)(n.code,{children:"update"})," operations) ",(0,r.jsx)(n.code,{children:"opencdc.StructuredData"})," representing the row state before the change."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"After"}),": ",(0,r.jsx)(n.code,{children:"opencdc.StructuredData"})," representing the row state after the change (or the current state for ",(0,r.jsx)(n.code,{children:"snapshot"})," and ",(0,r.jsx)(n.code,{children:"create"}),")."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Key"}),": Identifies the specific row. See Snapshot/CDC sections below for details."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Position"}),": Represents the point in the data stream. It's a JSON object containing ",(0,r.jsx)(n.em,{children:"either"})," a ",(0,r.jsx)(n.code,{children:"snapshot_position"})," field ",(0,r.jsx)(n.em,{children:"or"})," a ",(0,r.jsx)(n.code,{children:"cdc_position"})," field, structured as described below."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Metadata"}),": Contains standard OpenCDC fields plus:","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"mysql.server.id"}),": (CDC only) The originating MySQL server ID from the replication event header."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://conduit.io/docs/using/opencdc-record/#opencdckeyschema",children:"Key"})," and ",(0,r.jsx)(n.a,{href:"https://conduit.io/docs/using/opencdc-record/#opencdcpayloadschema",children:"payload"})," schema registry data."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"snapshot-records",children:"Snapshot Records"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Operation"}),": ",(0,r.jsx)(n.code,{children:"snapshot"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsxs)(n.strong,{children:["Payload ",(0,r.jsx)(n.code,{children:"After"})]}),": ",(0,r.jsx)(n.code,{children:"opencdc.StructuredData"})," with all column values."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Key"}),":","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["With Primary Key(s): ",(0,r.jsx)(n.code,{children:"opencdc.StructuredData"})," using primary key columns and values."]}),"\n",(0,r.jsxs)(n.li,{children:["Without Primary Key(s) (using ",(0,r.jsx)(n.code,{children:"LIMIT"}),"/",(0,r.jsx)(n.code,{children:"OFFSET"}),"): ",(0,r.jsx)(n.code,{children:"opencdc.RawData"})," string ",(0,r.jsx)(n.code,{children:'"<table_name>_<row_offset>"'}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsxs)(n.strong,{children:["Position (",(0,r.jsx)(n.code,{children:"snapshot_position"})," field)"]}),": A JSON object containing:","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"snapshots"}),": (object) Maps table names to their specific snapshot position object.","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.em,{children:"(Single Primary Key Table)"}),": Contains ",(0,r.jsx)(n.code,{children:"last_read"})," (any) and ",(0,r.jsx)(n.code,{children:"snapshot_end"})," (any)."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.em,{children:"(Multiple Primary Key Table)"}),": Contains an array of objects, each with ",(0,r.jsx)(n.code,{children:"key_name"})," (string), ",(0,r.jsx)(n.code,{children:"last_read"})," (any), and ",(0,r.jsx)(n.code,{children:"snapshot_end"})," (any)."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.em,{children:"(No Primary Key Table)"}),": Table entry might be missing or empty (offset is not persisted)."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}
1),"\n",(0,r.jsx)(n.h4,{id:"cdc-records",children:"CDC Records"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Operation"}),": Either ",(0,r.jsx)(n.code,{children:"create"}),", ",(0,r.jsx)(n.code,{children:"update"})," or ",(0,r.jsx)(n.code,{children:"delete"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Key"}),":","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["With Primary Key(s): ",(0,r.jsx)(n.code,{children:"opencdc.StructuredData"})," using primary key columns and values (from the ",(0,r.jsx)(n.code,{children:"After"})," state)."]}),"\n",(0,r.jsxs)(n.li,{children:["Without Primary Key(s): ",(0,r.jsx)(n.code,{children:"opencdc.RawData"})," string ",(0,r.jsx)(n.code,{children:'"<binlog_file_name>_<log_position>"'}),"."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Payload"}),":","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"Before"}),": (For ",(0,r.jsx)(n.code,{children:"update"})," only) ",(0,r.jsx)(n.code,{children:"opencdc.StructuredData"})," with pre-update column values."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"After"}),": ",(0,r.jsx)(n.code,{children:"opencdc.StructuredData"})," with post-change column values (for ",(0,r.jsx)(n.code,{children:"create"}),", ",(0,r.jsx)(n.code,{children:"update"}),") or pre-deletion values (for ",(0,r.jsx)(n.code,{children:"delete"}),")."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsxs)(n.strong,{children:["Position (",(0,r.jsx)(n.code,{children:"cdc_position"})," field)"]}),": Encodes the binlog location in a JSON object with the following fields.","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"name"}),": (string) Binlog file name."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"pos"}),": (uint32) Position within the binlog file."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"prev"}),": (object, optional) Position of the preceding event, containing ",(0,r.jsx)(n.code,{children:"name"})," (string) and ",(0,r.jsx)(n.code,{children:"pos"})," (uint32). Omitted if not applicable."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"idx"}),": (int, optional) Row index within a potentially multi-row MySQL replication event. Omitted if zero or not applicable."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"destination",children:"Destination"}),"\n",(0,r.jsxs)(n.p,{children:["The MySQL destination takes a slice of ",(0,r.jsx)(n.code,{children:"opencdc.Record"})," and writes them in batches to MySQL. It will use the ",(0,r.jsx)(n.code,{children:"opencdc.collection"})," field in the metadata to determine the table to write to."]}),"\n",(0,r.jsx)(n.h3,{id:"upsert-behavior",children:"Upsert Behavior"}),"\n",(0,r.jsxs)(n.p,{children:["If the target table contains a column with a unique constraint (this includes PRIMARY KEY and UNIQUE indexes), records will be upserted. Otherwise, they will be appended. Support for updating tables without unique constraints is tracked ",(0,r.jsx)(n.a,{href:"https://github.com/conduitio-labs/conduit-connector-mysql/issues/66",children:"here"}),"."]}),"\n",(0,r.jsx)(n.p,{children:"If the target table already contains a record with the same key, the Destination will upsert with its current received values. Because Keys must be unique, this can overwrite and thus potentially lose data, so keys should be assigned correctly from the Source."}),"\n",(0,r.jsx)(n.p,{children:"If a unique key is not present in the target table, the record will be simply appended."}),"\n",(0,r.jsx)(n.h2,{id:"requirements-and-compatibility",children:"Requirements and compatibility"}),"\n",(0,r.jsx)(n.p,{children:"The connector is tested against MySQL v8.0. Compatibility with older versions isn't guaranteed."}),"\n",(0,r.jsx)(n.h3,{id:"mysql-server-requirements",children:"MySQL Server Requirements:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Binary Log (binlog) must be enabled."}),"\n",(0,r.jsx)(n.li,{children:"Binlog format must be set to ROW."}),"\n",(0,r.jsx)(n.li,{children:"Binlog row image must be set to FULL."}),"\n",(0,r.jsxs)(n.li,{children:["Tables must have ",(0,r.jsx)(n.strong,{children:"sortable"})," primary keys."]}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"mysql-user-privileges",children:"MySQL User Privileges:"}),"\n",(0,r.jsx)(n.p,{children:"For Snapshot and CDC modes, the following privileges are required:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"SELECT"}),"\n",(0,r.jsx)(n.li,{children:"LOCK TABLES"}),"\n",(0,r.jsx)(n.li,{children:"RELOAD"}),"\n",(0,r.jsx)(n.li,{children:"REPLICATION CLIENT"}),"\n",(0,r.jsx)(n.li,{children:"REPLICATION SLAVE"}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"source-parameters",children:"Source Parameters"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'version: 2.2\npipelines:\n - id: example\n status: running\n connectors:\n - id: example-source\n type: source\n plugin: "mysql"\n name: example-source\n settings:\n # The connection string for the MySQL database.\n # Type: string\n dsn: ""\n # Represents the tables to read from. - By default, no tables are\n # included, but can be modified by adding a comma-separated string of\n # regex patterns. - They are applied in the order that they are\n # provided, so the final regex supersedes all previous ones. - To\n # include all tables, use "*". You can then filter that list by adding\n # a comma-separated string of regex patterns. - To set an "include"\n # regex, add "+" or nothing in front of the regex. - To set an\n # "exclude" regex, add "-" in front of the regex. - e.g. "-.*meta$,\n # wp_postmeta" will exclude all tables ending with "meta" but include\n # the table "wp_postmeta".\n # Type: string\n tables: ""\n # Disables verbose cdc driver logs.\
1n # Type: bool\n cdc.disableLogs: ""\n # Controls whether the snapshot is done.\n # Type: bool\n snapshot.enabled: "true"\n # Limits how many rows should be retrieved on each database fetch on\n # snapshot mode.\n # Type: int\n snapshot.fetchSize: "10000"\n # Allows a snapshot of a table with neither a primary key nor a\n # defined sorting column. The opencdc.Position won\'t record the last\n # record read from a table.\n # Type: bool\n snapshot.unsafe: ""\n # Allows to force using a custom column to sort the snapshot.\n # Type: string\n tableConfig.*.sortingColumn: ""\n # Maximum delay before an incomplete batch is read from the source.\n # Type: duration\n sdk.batch.delay: "0"\n # Maximum size of batch before it gets read from the source.\n # Type: int\n sdk.batch.size: "0"\n # Specifies whether to use a schema context name. If set to false, no\n # schema context name will be used, and schemas will be saved with the\n # subject name specified in the connector (not safe because of name\n # conflicts).\n # Type: bool\n sdk.schema.context.enabled: "true"\n # Schema context name to be used. Used as a prefix for all schema\n # subject names. If empty, defaults to the connector ID.\n # Type: string\n sdk.schema.context.name: ""\n # Whether to extract and encode the record key with a schema.\n # Type: bool\n sdk.schema.extract.key.enabled: "true"\n # The subject of the key schema. If the record metadata contains the\n # field "opencdc.collection" it is prepended to the subject name and\n # separated with a dot.\n # Type: string\n sdk.schema.extract.key.subject: "key"\n # Whether to extract and encode the record payload with a schema.\n # Type: bool\n sdk.schema.extract.payload.enabled: "true"\n # The subject of the payload schema. If the record metadata contains\n # the field "opencdc.collection" it is prepended to the subject name\n # and separated with a dot.\n # Type: string\n sdk.schema.extract.payload.subject: "payload"\n # The type of the payload schema.\n # Type: string\n sdk.schema.extract.type: "avro"\n'})}),"\n",(0,r.jsx)(n.h2,{id:"destination-parameters",children:"Destination Parameters"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'version: 2.2\npipelines:\n - id: example\n status: running\n connectors:\n - id: example-destination\n type: destination\n plugin: "mysql"\n name: example-destination\n settings:\n # The connection string for the MySQL database.\n # Type: string\n dsn: ""\n # Maximum delay before an incomplete batch is written to the\n # destination.\n # Type: duration\n sdk.batch.delay: "0"\n # Maximum size of batch before it gets written to the destination.\n # Type: int\n sdk.batch.size: "0"\n # Allow bursts of at most X records (0 or less means that bursts are\n # not limited). Only takes effect if a rate limit per second is set.\n # Note that if `sdk.batch.size` is bigger than `sdk.rate.burst`, the\n # effective batch size will be equal to `sdk.rate.burst`.\n # Type: int\n sdk.rate.burst: "0"\n # Maximum number of records written per second (0 means no rate\n # limit).\n # Type: float\n sdk.rate.perSecond: "0"\n # The format of the output record. See the Conduit documentation for a\n # full list of supported formats\n # (https://conduit.io/docs/using/connectors/configuration-parameters/output-format).\n # Type: string\n sdk.record.format: "opencdc/json"\
1n # Options to configure the chosen output record format. Options are\n # normally key=value pairs separated with comma (e.g.\n # opt1=val2,opt2=val2), except for the `template` record format, where\n # options are a Go template.\n # Type: string\n sdk.record.format.options: ""\n # Whether to extract and decode the record key with a schema.\n # Type: bool\n sdk.schema.extract.key.enabled: "true"\n # Whether to extract and decode the record payload with a schema.\n # Type: bool\n sdk.schema.extract.payload.enabled: "true"\n'})})]})}function y(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(j,{...e})}):j(e)}},55281:(e,n,t)=>{t.d(n,{A:()=>A});var s=t(98587),r=t(58168),i=t(96540),o=t(34164),d=t(75659),c=t(28466),a=t(11848),l=t(46126),h=t(60458),u=t(96852),x=t(47859),p=t(38413),m=t(31609);function j(e){return(0,m.Ay)("MuiLink",e)}const y=(0,p.A)("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]);var g=t(86481),b=t(771);const f={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},w=({theme:e,ownerState:n})=>{const t=(e=>f[e]||e)(n.color),s=(0,g.Yn)(e,`palette.${t}`,!1)||n.color,r=(0,g.Yn)(e,`palette.${t}Channel`);return"vars"in e&&r?`rgba(${r} / 0.4)`:(0,b.X4)(s,.4)};var v=t(74848);const T=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],S=(0,a.Ay)(x.A,{name:"MuiLink",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:t}=e;return[n.root,n[`underline${(0,c.A)(t.underline)}`],"button"===t.component&&n.button]}})(({theme:e,ownerState:n})=>(0,r.A)({},"none"===n.underline&&{textDecoration:"none"},"hover"===n.underline&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},"always"===n.underline&&(0,r.A)({textDecoration:"underline"},"inherit"!==n.color&&{textDecorationColor:w({theme:e,ownerState:n})},{"&:hover":{textDecorationColor:"inherit"}}),"button"===n.component&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${y.focusVisible}`]:{outline:"auto"}})),A=i.forwardRef(function(e,n){const t=(0,l.b)({props:e,name:"MuiLink"}),{className:a,color:x="primary",component:p="a",onBlur:m,onFocus:y,TypographyClasses:g,underline:b="always",variant:w="inherit",sx:A}=t,_=(0,s.A)(t,T),{isFocusVisibleRef:k,onBlur:C,onFocus:q,ref:D}=(0,h.A)(),[I,L]=i.useState(!1),M=(0,u.A)(n,D),R=(0,r.A)({},t,{color:x,component:p,focusVisible:I,underline:b,variant:w}),O=(e=>{const{classes:n,component:t,focusVisible:s,underline:r}=e,i={root:["root",`underline${(0,c.A)(r)}`,"button"===t&&"button",s&&"focusVisible"]};return(0,d.A)(i,j,n)})(R);return(0,v.jsx)(S,(0,r.A)({color:x,className:(0,o.A)(O.root,a),classes:g,component:p,onBlur:e=>{C(e),!1===k.current&&L(!1),m&&m(e)},onFocus:e=>{q(e),!0===k.current&&L(!0),y&&y(e)},ref:M,ownerState:R,variant:w,sx:[...Object.keys(f).includes(x)?[]:[{color:x}],...Array.isArray(A)?A:[A]]},_))})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.