Skip to content

Commit 712c3ba

Browse files
GHMattiGHMatti
authored andcommitted
Added a warning against using MySQL8
1 parent ce55f2d commit 712c3ba

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/server/mysql.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class MySQL {
2222

2323
this.pool.query('SELECT VERSION()', (error, result) => {
2424
if (!error) {
25-
const { versionPrefix, version } = formatVersion(result[0]['VERSION()']);
26-
profiler.setVersion(`${versionPrefix}:${version}`);
25+
const formattedVersion = formatVersion(result[0]['VERSION()']);
26+
profiler.setVersion(formattedVersion);
2727
logger.log('\x1b[32m[mysql-async]\x1b[0m Database server connection established.');
2828
} else {
2929
logger.error(`[ERROR] ${error.message}`);

src/server/profiler.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ class Profiler {
5252
}
5353
}
5454

55-
setVersion(version) {
56-
this.version = version;
55+
setVersion({ versionPrefix, version }) {
56+
if (version.startsWith('8.0.') && versionPrefix === 'MySQL') {
57+
this.logger.error('[mysql-async] [Warning] It is recommended to run MySQL 5 or MariaDB with mysql-async. You may experience performance issues under load by using MySQL 8.');
58+
}
59+
this.version = `${versionPrefix}:${version}`;
5760
}
5861

5962
fillExecutionTimes(interval) {

0 commit comments

Comments
 (0)