You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/data-factory/connector-mysql.md
+40-1Lines changed: 40 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: jianleishen
6
6
ms.subservice: data-movement
7
7
ms.custom: synapse
8
8
ms.topic: conceptual
9
-
ms.date: 10/09/2024
9
+
ms.date: 10/28/2024
10
10
ms.author: jianleishen
11
11
---
12
12
@@ -311,6 +311,9 @@ When copying data from MySQL, the following mappings are used from MySQL data ty
311
311
|`varchar`|`String`|`String`|
312
312
|`year`|`Int`|`Int`|
313
313
314
+
>[!NOTE]
315
+
>Storing bit(1) as Boolean in the legacy version was a bug and it was fixed in the recommended version. If you still use Boolean value in the recommended version, set the column type as tinybit(1).
316
+
314
317
## Lookup activity properties
315
318
316
319
To learn details about the properties, check [Lookup activity](control-flow-lookup-activity.md).
@@ -325,6 +328,42 @@ Here are steps that help you upgrade your MySQL connector:
325
328
326
329
1. The latest driver version v2 supports more MySQL versions. For more information, see [Supported capabilities](connector-mysql.md#supported-capabilities).
327
330
331
+
### MySQL best practices
332
+
333
+
This section introduces some best practices for MySQL connector.
334
+
335
+
#### Cannot load SSL key
336
+
337
+
If you are using MySQL connector recommended version with SSL Key as a connection property, you might hit the following issues:
338
+
- Could not load the client key from your_pem_file
The reason for these issues is the recommended version cannot decrypt the PCKS#8 format. You need to convert the PEM format to PCKS#1.
342
+
343
+
#### Treat tiny as Boolean
344
+
345
+
The recommended version treats tinyint(1) as Boolean type by default. For more information, see this [article](https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html).
346
+
347
+
To have the connector return this as numeric, set `treatTinyAsBoolean=false` in the connection properties.
348
+
349
+
#### Treat char(36) as GUID
350
+
351
+
The recommended version will treat Char(36) as GUID type by default for better performance.
352
+
353
+
The connector treats Char(36) fields as GUIDs for easier database handling. This treatment simplifies operations like inserting, updating, and retrieving GUID values, ensuring they are consistently managed as GUID objects instead of plain strings. This behavior is particularly useful in scenarios where GUIDs are used as primary keys or unique identifiers, providing better performance.
354
+
355
+
You can also change this behavior by setting `guidFromat=none` in connection property.
356
+
357
+
#### Cannot read zero or invalid date
358
+
359
+
The recommended version cannot read zero or invalid date value. It is by default.
360
+
361
+
MySQL permits you to store a "zero" value of '0000-00-00' as a "dummy date." In some cases, this is more convenient than using NULL values, and uses less data and index space. To disallow '0000-00-00', enable the [NO_ZERO_DATE](https://dev.mysql.com/doc/refman/8.4/en/sql-mode.html#sqlmode_no_zero_date) mode. For more information, see this [article](https://dev.mysql.com/doc/refman/8.4/en/date-and-time-types.html).
362
+
363
+
For zero date value, you can set `convertZeroDateTime=true` and `allowZeroDateTime=true`.
364
+
365
+
For an invalid date value, you can modify your SQL to wrap the column as String type.
366
+
328
367
## Differences between the recommended and the legacy driver version
329
368
330
369
The table below shows the data type mapping differences between MySQL using the recommended and the legacy driver version.
0 commit comments