Connecting to MySQL
Prerequisites
- The MySQL instance is accessible over the network from the PuppyGraph instance.
Configuration
| Configuration | Explanation |
|---|---|
| Username | The username of the database |
| Password | The password of the database |
| JDBC URI | A JDBC compatible connection URI of the data source. Read this page for more details on how to construct the URI. |
| JDBC Driver Class | The class name of the JDBC driver. Please choose the name based on the version of the driver that is compatible with your MySQL database. For example, if you use MySQL (Connector/J):
Or if you use MariaDB Connector/J:
|
| JDBC Driver URL | The URL of the MySQL-compatible JDBC Driver. Please choose the version of the driver that is compatible with your MySQL database. |
Data Type Mapping
| MySQL Type | PuppyGraph Type | Description |
|---|---|---|
BOOLEAN, BOOL, TINYINT(1), BIT |
Boolean |
True or false. BOOLEAN is stored as TINYINT(1) |
TINYINT |
Byte |
8-bit signed integer, other than TINYINT(1) |
TINYINT UNSIGNED |
Short |
Widened to hold the unsigned range |
SMALLINT |
Short |
16-bit signed integer |
SMALLINT UNSIGNED |
Int |
Widened to hold the unsigned range |
MEDIUMINT, INT |
Int |
32-bit signed integer |
MEDIUMINT UNSIGNED, INT UNSIGNED |
Long |
Widened to hold the unsigned range |
BIGINT |
Long |
64-bit signed integer |
BIGINT UNSIGNED |
HugeInt |
Widened to hold the unsigned range |
FLOAT |
Float |
32-bit IEEE 754 floating point |
DOUBLE, REAL |
Double |
64-bit IEEE 754 floating point |
DECIMAL(P, S), NUMERIC(P, S) |
Decimal(P, S) |
Fixed-point decimal; precision P, scale S |
CHAR, VARCHAR, TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT |
String |
Character strings |
JSON |
String |
JSON document as text |
DATE |
Date |
Calendar date without time or timezone |
DATETIME, TIMESTAMP |
DateTime |
Date and time |
ENUM, SET |
String |
Read as text |
YEAR |
Date |
Year, read as a date |
TINYINT(1)is reported as a boolean under the driver's defaulttinyInt1isBit=truesetting. WithtinyInt1isBit=falseit maps toBytelike otherTINYINTcolumns.- MySQL creates a
REALcolumn asDOUBLE, so it maps toDouble. If the server runs with theREAL_AS_FLOATSQL mode,REALcolumns are created asFLOATand map toFloat. TIMEis not supported. Columns of this type are listed in Schema Builder, but you cannot add them to a node or edge as attributes.- Any other MySQL type is read as
String.
If you need a data type that is not supported, or one that is not listed here, contact us.
Demo
See Querying MySQL Data as a Graph for a complete demo for MySQL. The demo includes setting up the connection to a MySQL instance.