Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Release date: 25 Jul 2025
MariaDB Connector/Node.js 3.4.5 is a Stable (GA) release.
For an overview of MariaDB Connector/Node.js see the page
: Fixed SSL connection error with custom CA certificates causing "TypeError: validationFunction is not a function"
: Added missing TypeScript type definitions (@types/geojson, @types/node) to dependencies
This category contains release notes for releases in the MariaDB Connector/Node.js 3.x series
Release date: 3 Jul 2025
MariaDB Connector/Node.js 3.4.4 is a Stable (GA) release.
For an overview of MariaDB Connector/Node.js see the page
: TypeScript types/share.d.ts and types/callback.d.ts are not published
Download | Release Notes | Changelog |
Release date: 5 Jun 2024
MariaDB Connector/Node.js 3.3.1 is a Stable (GA) release.
For an overview of MariaDB Connector/Node.js see the page
A pool timeout error now returns connection timeout details
Connection can possibly stay in hang state after batch execution
When using batch with big values, a connection might be in a wrong state, which can result in Server error: '(Got an error reading communication packets)'
Client TCP error ECONRESET
Release date: 10 Oct 2025
MariaDB Connector/Node.js 3.5.0-rc is an release.
For an overview of MariaDB Connector/Node.js see the page
An issue was discovered in the Connector/Node.js 3.4.3 release shortly after release and it has been replaced by Connector/Node.js 3.4.4. See the 3.4.4 for more details.
Release date: 2 Jul 2025
MariaDB Connector/Node.js 3.4.3 is a (GA) release.
CONJS-292 Connector does not permit passing a String object (≠ native string) parameter
const objVal = new String('myValue');
CONJS-286 When using a prepared statement and explicitly disabling prepare cache using prepareCacheLength=0, the connector might not retrieve results anymore
CONJS-287 Typescript is missing 'QueryOption' for the 'prepare' command
CONJS-293 When using batch, javascript Date values that are not in the range 1970-01-01 00:00:01 - 2038-01-19 03:14:07 are saved as null
For an overview of MariaDB Connector/Node.js see the page
CONJS-309: Enhanced TypeScript support by adding mariadb/callback type definitions
CONJS-319: Resolved SSL identity verification issue where servername parameter wasn't being properly validated
CONJS-320: Fixed cluster filtering problems in query/execute operations when using the callback API
CONJS-321: Moved @types/geojson and @types/node packages to development dependencies for cleaner production builds
Download | Release Notes | Changelog |
Release date: 25 Apr 2025
MariaDB Connector/Node.js 3.4.2 is a Stable (GA) release.
For an overview of MariaDB Connector/Node.js see the page
: Repeated named placeholders causes "Placeholder is not defined"
| | |
Release date: 24 Oct 2024
MariaDB Connector/Node.js 3.4.0 is a (GA) release.
For an overview of MariaDB Connector/Node.js see the page
| | |
Release date: 2 Apr 2025
MariaDB Connector/Node.js 3.4.1 is a (GA) release.
For an overview of MariaDB Connector/Node.js see the page
| | |
Release date: 17 Mar 2023
MariaDB Connector/Node.js 3.1.1 is a (GA) release.
For an overview of MariaDB Connector/Node.js see the page
| | |
Release date: 14 Sep 2023
MariaDB Connector/Node.js 3.2.1 is a (GA) release.
For an overview of MariaDB Connector/Node.js see the page
When working with JSON fields in MariaDB and MySQL, it's important to note that the handling differs between the two database systems.
autoJsonMap Option: The autoJsonMap option provides flexibility in MariaDB. You can choose to have the connector return either JSON objects or string representations of the JSON data.
jsonStrings Option: The jsonStrings option introduces a similar choice for MySQL JSON fields. It allows you to specify whether the connector should return JSON objects or string values.
In essence, the JSON fields will be returned either as a JSON or String will depend on 2 different options depending on the database you’re working with.
CONJS-296 Add option enableKeepAlive / keepAliveInitialDelay alias for keepAliveDelay for mysql2 compatibility
The keepAliveDelay option in MariaDB connectors controls the frequency of keep-alive packets sent to maintain a persistent connection.
Disabled: When set to 0, keep-alive functionality is disabled.
Enabled: For any non-zero value, keep-alive packets are sent at the specified interval.
MySQL 2 Compatibility: To ensure compatibility with the MySQL 2 connector, the enableKeepAlive and keepAliveInitialDelay options have been added.
enableKeepAlive: If disabled, keepAliveDelay is automatically set to 0, effectively disabling keep-alive.
enableKeepAlive: If enabled, keepAliveDelay is set to the value specified in keepAliveInitialDelay.
In summary, the keepAliveDelay option determines the keep-alive frequency, while the enableKeepAlive and keepAliveInitialDelay options provide compatibility with MySQL 2 connectors by allowing you to control whether keep-alive is enabled and set the initial delay.
CONJS-303 DMLs are not returning an output while streaming
CONJS-306: Support "zero configuration ssl" for parsec authentication
CONJS-315: Fixed issue with incorrect data for result-set rows of exactly 16M of data
CONJS-312: Improved pool error messages when failing to create connections
CONJS-313: Now allows using question mark parameters even when using namedPlaceholders option (mysql compatibility)
: Added Connection close alias for end function in TypeScript definition
: Fixed Bulk operations potentially returning unexpected error "Cannot read properties of undefined (reading '0')"
: Added capability to return all Bulk insert IDs for MariaDB server 11.5.1+
: Fixed bulk operations ending with "Got a packet bigger than 'max_allowed_packet' bytes" error
: Enhanced handling of non-bulk batched operations to avoid out-of-memory errors for batches not using bulk
CONJS-262 Binary result-set parsing performance improvement, avoiding to chromium slow issue detail?id=7161
CONJS-265 permit configuration of console warning message to be exported
CONJS-266 Option infileStreamFactory addition for compatibility
Download | Release Notes | Changelog |
Release date: 15 Feb 2023
MariaDB Connector/Node.js 3.1.0 is a Stable (GA) release.
For an overview of MariaDB Connector/Node.js see the page
Connector now set session timezone, solving issue with , removing needs of client side conversion.
This requires that when using timezone options, to have corresponding server TZ data filled.
better metadata parsing performance
performance improvement when parsing lots of parameter
faster execution for known length packet
see for updated result compared to other connectors
Make result set's meta property non-enumerable
Allow to pass TypeScript generic types without need of "as"
When executing batch with a parameter can be too long to fit in one mysql packet, parameter can have 4 byte missing
datatype TIME wrong binary decoding when not having microseconds
When using connection with callback, pre-commands (like initSql) might not always be executed first
Download | Release Notes | Changelog |
Release date: 19 Dec 2023
MariaDB Connector/Node.js 3.2.3 is a Stable (GA) release.
For an overview of MariaDB Connector/Node.js see the page
Add support for connection redirection, an upcoming MariaDB Server and MaxScale feature
Wrong binary decoding of 00:00:00 TIME values
Error doesn't always have parameters according to option
Bulk insert error when last bunch of parameters is reaching max_allowed_packet
Disabling BULK insert for one batch is not possible
Download | Release Notes | Changelog |
Release date: 18 Sep 2024
MariaDB Connector/Node.js 3.3.2 is a Stable (GA) release.
For an overview of MariaDB Connector/Node.js see the page
delay TLS identity validation until certificate normal or fingerprint validation
TypeScript type definition file for SqlError constructor does not match actual constructor
Typescript connection option timeout in place of queryTimeout
Typescript wrong named longlong in place of bigint
| | |
Release date: 26 Jul 2022
MariaDB Connector/Node.js 3.0.1 is a (GA) release.
For an overview of MariaDB Connector/Node.js see the page
| | |
Release date: 21 Mar 2024
MariaDB Connector/Node.js 3.3.0 is a (GA) release.
For an overview of MariaDB Connector/Node.js see the page
Release date: 1 Mar 2022
MariaDB Connector/Node.js 3.0.0 is a (GA) release.
For an overview of MariaDB Connector/Node.js see the page
see for 3.0.0 content from previous version.
| | |
Release date: 3 May 2023
MariaDB Connector/Node.js 3.1.2 is a (GA) release.
For an overview of MariaDB Connector/Node.js see the page
CONJS-240 adding a Prepare result wrapper to avoid multiple close issue with cache
CONJS-241 metaAsArray missing option in typescript description
Pool might return a common error ‘retrieve connection from pool timeout after XXXms’ in place of real error.[CONJS-200]
Trace option now works when using pool/cluster. It is recommended to activate the trace option in development Since driver is asynchronous, enabling this option to save initial stack when calling any driver methods. This allows having the caller method and line in the error stack, permitting error easy debugging. The problem is this error stack is created using Error.captureStackTrace that is very slow. To give an idea, this slows down by 10% a query like 'select * from mysql.user LIMIT 1', so not recommended in production. [CONJS-209]
Pool error description is improved indicating pool information, like [CONJS-208]:
node.js 18 supported [CONJS-197]
New option checkNumberRange. When used in conjunction of decimalAsNumber, insertIdAsNumber or bigIntAsNumber, if conversion to number is not exact, connector will throw an error. This permits easier compatibility with mysql/mysql2 and 2.x version driver version. [CONJS-198]
Performance enhancement for multi-rows resultset. Internal benchmarks show improved performance by 10% for a result-set of 1000 rows.[]
[CONJS-193] Wrong error returned "Cannot read properties of undefined… … (reading 'charset')" when error during handshake
[CONJS-194] Charset change using parameterized query fails with "Uncaught TypeError: opts.emit is not a function"
[CONJS-195] Error "cannot mix BigInt and other types" when parsing negative bigint
[CONJS-196] connection.close() is now really an alias or connection.release()
[] wrong return type for batch() on typescript
[] typecast geometry parsing error
[] support pre 4.1 error format for 'too many connection' error
[] encoding error for connection attributes when using changeUser with connection attributes
[] possible race condition on connection destroy when no other connection can be created
[] handle password array when using authentication plugin “pam_use_cleartext_plugin”
[] query hanging when using batch with option timeout in place of error thrown
For a complete list of changes made in this release, with links to detailed information on each push, see the changelog.
In order to have SSL connections, there was 3 solutions:
Have server certificates generated with trusted node.js Certificate Authorities (CA), configuration was then like ssl: true.
Configure connector with server certificate like:ssl: { ca: [ fs.readFileSync('server-cert.pem') ] }
disable certificate ssl verification (not secured!) like:ssl: { rejectUnauthorized: true }
Since MariaDB 11.4.1 (MDEV-31855), enabling SSL is super easy, with simple configuration like:ssl: true, even if server has not configure ssl certificates. The connector doesn't need to know server certificate anymore, if password is not empty. This is part of mission impossible zero configuration, client validating ssl certificates using client password.
Previous use of connection.execute was executing PREPARE command first, read PREPARE response, then execute EXECUTE command and finally read EXECUTE response.
New implementation, when using MariaDB server 10.2+ and with pipelining option enable (default value) will execute PREPARE, execute EXECUTE, then only read PREPARE response and read EXECUTE response. This permit to avoid much of the network latency.
Benchmarking results using local database: (distant database would have even better result)
This improvement is for first execution of a specific query, since PREPARE is cached by default, second execution would only execute EXECUTE command
CONJS-279 Improve query encoding and decoding performance
CONJS-281 cannot connect to 11.3+ server with character-set-collations = utf8mb4=uca1400_ai_ci
CONJS-277 using connection.importFile when connection is not connected to database result in error
CONJS-278 Possible buffer overwrite when sending query bigger than 16M
CONJS-282 error when using mysql_clear_test password authentication plugin
wrong decoding of binary unsigned MEDIUMINT
DECIMAL field wrong decoding with deprecated option 'supportBigNumbers' set
merged correction from 2.5.6
[CONJS-185] considering BIT(1) as boolean (option bitOneIsBoolean permit to disable that behavior for compatibility)
pool ensuring multi-request process order
set parser function once per result-set for better performance
For a complete list of changes made in this release, with links to detailed information on each push, see the changelog.
CONJS-249 add connection.listeners function to permit TypeORM compatibility
Download | Release Notes | Changelog |
Release date: 30 Jun 2021
MariaDB Connector/Node.js 3.0.0 is a Beta release.
Do not use beta releases in production!
For an overview of MariaDB Connector/Node.js see the page
Driver now permits using prepared statement. This methods are compatible with mysql2 with some differences:
permit streaming parameters
execute use by default a prepared cache that hasn't infinite length (option ‘prepareCacheLength’ with default to 256)
Implement new feature, skipping metadata when possible for better performance
New Connection methods:
: Prepares a query.
: Prepare and Executes a query.
Example:
Or directly :
If reusing query multiple time, this permits to perform better, specifically using . Performance comparison with mysql2 driver show up to 20% performance gain. More info will follow before GA release.
Default behaviour for decoding / datatype for 2.x version and mysql/mysql2 drivers return a javascript object. BIGINT / DECIMAL values might not be in the safe range, resulting in approximate results.
Since 3.x version, driver has reliable default, returning:
DECIMAL => javascript String
BIGINT => javascript object
For compatibility with the previous versions or mysql/mysql driver, 3 options have been added to return BIGINT/DECIMAL as Number, like previous defaults.
Previous options supportBigNumbers and bigNumberStrings still exist for compatibility, but are now deprecated.
Driver permit mapping the logs to an external logger. There is 3 caller functions:
network(string): called for each network exchange.
query(string): called for each commands
error(Error): called for each error.
if setting one function, function will be used for all loggers. (ie. logger: console.log === logger: { network: console.log, query: console.log, error: console.log})
Example:
For a complete list of changes made in this release, with links to detailed information on each push, see the .
Download | Release Notes | Changelog |
Release date: 27 Oct 2022
MariaDB Connector/Node.js 3.0.2 is a Stable (GA) release.
For an overview of MariaDB Connector/Node.js see the page
Like queryStream, execute command can now be streamed as well for huge resultset, to avoid charging the whole resultset in memory. Example :
Metadata column name gets sporadic corrupted
Session timezone unset on connection re-use with connection pool
when throwing an error when using option leakDetectionTimeout, might result in throwing wrong error with Cannot read properties of null (reading 'leaked')
| | |
Release date: 20 Oct 2021
MariaDB Connector/Node.js 3.0.0-rc is an release.
Do not use non-stable (non-GA) releases in production!
For an overview of MariaDB Connector/Node.js see the page
see for 3.0.0 content from previous version.
const pool = mariadb.createPool({
host: 'mydb.com',
user: 'myUser',
connectionLimit: 5,
trace: true
});
await pool.query('wrong query');
/* will throw an error like :
SqlError: (conn=15868, no: 1064, SQLState: 42000) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'wrong query' at line 1
sql: wrong query - parameters:[]
at Object.module.exports.createError (errors.js:57:10)
at ...
From event:
at Function._PARAM (\integration\test-pool.js:60:18)
at …
text: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'wrong query' at line 1",
sql: 'wrong query - parameters:[]',
fatal: false,
errno: 1064,
sqlState: '42000',
code: 'ER_PARSE_ERROR'
*/SqlError: (conn=-1, no: 45028, SQLState: HY000) retrieve connection from pool timeout after 200ms
(pool connections: active=1 idle=0 limit=1)
at Object.module.exports.createError
…CONJS-219 prepare cache was not limited to prepareCacheLength but can increase up to 2x the prepareCacheLength value, leading to possible ER_MAX_PREPARED_STMT_COUNT_REACHED
CONJS-228 improving prepare cache performance
CONJS-226 missing typescript metaAsArray option and documentation
CONJS-213 update error code with recent MariaDB server
CONJS-215 Executing after prepare close throw an undescriptive error
CONJS-221 option debugLen and logParam are not documented
CONJS-227 Allow setting idleTimeout to 0
CONJS-214 missing pool.closed typescript definition
CONJS-216 remove please-upgrade-node dependency
CONJS-224 missing typescript checkNumberRange option definition
Before 3.0, implementation ensure connection state, at the cost of not handling backpressure well.
Streaming a resultset ensured the connection state before version 3.0, at the cost of not handling backpressure well. Since the goal of queryStream is to avoid the use of a large amount of memory, handling of backpressure has been optimized. If data handling takes some amount of time, the socket is paused to avoid the node socket buffer growing indefinitely. This has an impact on the use of function stream.pipeline as queryStream now needs to be closed explicitly to ensure that a connection is not in a wrong state ( unhandled rows in the socket buffer). Example
pool cluster option removeNodeErrorCount now default to infinity. This avoids having pool removed from cluster when a server temporarily fails.
pool option resetAfterUse now default to false. This permit avoids executing a command each time a connection is returned to pool.
The pool cluster option removeNodeErrorCount now defaults to infinity. This avoids that some pool is removed from the cluster when a server temporarily fails.
The pool option resetAfterUse now defaults to false. This avoids the execution of a COM_RESET each time a connection is returned to the pool.
stream
permits to set a function with parameter to set stream (since 3.0)
function
The option stream provides a way to execute a function with a callback parameter before each connection stream creation.
This can permit setting a SSH Tunnel for example:
[CONJS-125] Batch operations now support the returning clause (example command like insert into XXX values (?,?,?) returning id)
[CONJS-125] permit using batch with returning clause
[CONJS-170] Pool.query(undefined) never release connection
[CONJS-173] not permitting providing null as a value without an array
[] Update code to recent Ecma version
[] performance improvement for multi-line result-set
For a complete list of changes made in this release, with links to detailed information on each push, see the changelog.
insertIdAsNumber
Whether the query should return last insert id from INSERT/UPDATE command as BigInt or Number. default return BigInt
boolean
false
decimalAsNumber
Whether the query should return decimal as Number. If enabled, this might return approximate values.
boolean
false
bigIntAsNumber
Whether the query should return BigInt data type as Number. If enabled, this might return approximate values.
boolean
false

const prepare = await shareConn.prepare('SELECT * FROM mysql.user where host = ?');
const stream = prepare.executeStream(['localhost']);
try {
for await (const row of stream) {
console.log(row);
}
} catch (e) {
queryStream.close();
}
prepare.close();const queryStream = connection.queryStream("SELECT * FROM mysql.user");
stream.pipeline(queryStream, transformStream, someWriterStream, (err) => { queryStream.close(); });const mariadb = require('mariadb');
const tunnel = require('tunnel-ssh');
const fs = require('fs');
const conn = await mariadb.createConnection({
user: 'dbuser',
password: 'dbpwd',
port: 27000,
stream: (cb) =>
tunnel(
{
// remote connection ssh info
username: 'sshuser',
host: '157.230.123.7',
port: 22,
privateKey: fs.readFileSync('./key.ppk'),
// database (here on ssh server)
dstHost: '127.0.0.1',
dstPort: 3306,
// local interface
localHost: '127.0.0.1',
localPort: 27000
},
cb
)
});const prepare = await conn.prepare('INSERT INTO mytable(id,val) VALUES (?,?)');
await prepare.execute([1, 'val1']);
prepare.close();await conn.execute('INSERT INTO mytable(id,val) VALUES (?,?)', [1, 'val1']);const mariadb = require('mariadb');
const winston = require('winston');
const logger = winston.createLogger({
level: 'info',
transports: [
// - Write all logs with level `error` and below to `error.log`
// - Write all logs with level `info` and below to `combined.log`
new winston.transports.Console({ filename: 'error.log', level: 'error' }),
new winston.transports.Console({ filename: 'combined.log' })
]
});
const pool = mariadb.createPool({
host: 'mydb.com',
user:'myUser',
password: 'myPwd',
logger: {
network: (msg) => logger.silly(msg),
query: (msg) => logger.info(msg),
error: (err) => logger.error(err),
}
});Download | Release Notes | Changelog | Connector/Node.js Overview
Release date: 16 Oct 2023
MariaDB Connector/Node.js 3.2.2 is a Stable (GA) release.
For an overview of MariaDB Connector/Node.js see the About MariaDB Connector/Node.js page
Always send connection attributes, even when option connectAttributes is not set
avoid useless "set names utf8mb4" on connection creation if not needed
importFile method doesn't always throw error when imported commands fails #253
Ensure that option collation with id > 255 are respected
| | |
Release date: 19 Jun 2023
MariaDB Connector/Node.js 3.2.0 is a (GA) release.
For an overview of MariaDB Connector/Node.js see the page
importFile(options) → Promise
connection.importFile({file:'...', 'database': '...'}) → Promise
pool.importFile({file:'...', 'database': '...'}) → Promisepromise)
example:
CONJS-252 missing deprecated option supportBigNumbers and bigNumberStrings in Typescript
CONJS-254 ensuring option connectTimeout is respected : timeout is removed when socket is successfully established, in place of returning connection object. Wasn't set when using pipe/unix socket
CONJS-255 In some case, pipelining was use even option explicitly disable it
CONJS-256 method changeUser can lead to error when using multi-authentication and pipelining
All eventEmitters methods are not available on connections
SqlError sqlMessage property alias for text addition
await conn.importFile({
file: '/tmp/someFile.sql',
database: 'myDb'
});This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.
This page is: Copyright © 2025 MariaDB. All rights reserved.