Change mysql library to mysql2 as it is more maintained and support latest mysql authention (#862)

* Use mysql2 lib

* fix pool on acquire event cause MaxListenersExceededWarning (#854)

before: every query need to register pool on acquire event to specify queryFormat based on payload type
will cause MaxListenersExceededWarning

after:
from https://www.npmjs.com/package/mysql#pooling-connections

pool.query is a shortcut for pool.getConnection() -> connection.query() -> connection.release()

so use pool.getConnection and then
set queryFormat before query method be called

Co-authored-by: Dave Conway-Jones <dceejay@users.noreply.github.com>

* fix mysql require

* Add decimalNumbers flag true to mysql beta

* mysql remove old Timeout option, clarify timezone options

* add mysqlConnectionLimit settings option.

Co-authored-by: saknarak <saknarak@gmail.com>
This commit is contained in:
Dave Conway-Jones
2022-01-05 10:56:14 +00:00
committed by GitHub
parent e6930274e2
commit fea47843d7
4 changed files with 53 additions and 63 deletions

View File

@@ -22,7 +22,7 @@
</div>
<div class="form-row">
<label for="node-config-input-tz"><i class="fa fa-clock-o"></i> <span data-i18n="mysql.label.timezone"></span></label>
<input type="text" id="node-config-input-tz">
<input type="text" id="node-config-input-tz" placeholder="&#177;hh:mm">
</div>
<div class="form-row">
<label for="node-config-input-charset"><i class="fa fa-language"></i> <span data-i18n="mysql.label.charset"></span></label>
@@ -32,6 +32,7 @@
<label for="node-config-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
<input type="text" id="node-config-input-name" data-i18n="[placeholder]node-red:common.label.name">
</div>
<div class="form-tips"><span data-i18n="[html]mysql.tip"></span></div>
</script>
<script type="text/javascript">