const mysql2 = require('mysql2');

const connection = mysql2.createConnection({
    host: config.dbhost,
    user: config.dbuser,
    password: config.dbpass,
    database: config.dbname,
});

connection.connect((err) => {
    if (err) {
        console.error(err);
        return;
    }
    connection.end();
});

Uncaught Error Error: read ECONNRESET
    at node_internal_captureLargerStackTrace (internal/errors:477:5)
    at node_internal_errnoException (internal/errors:607:12)
    at onStreamRead (internal/stream_base_commons:217:20)
    at callbackTrampoline (internal/async_hooks:130:17)
    --- TickObject ---
    at init (internal/inspector_async_hook:25:19)
    at emitInitNative (internal/async_hooks:202:43)
    at emitInitScript (internal/async_hooks:505:3)
    at nextTick (internal/process/task_queues:133:5)
    at onDestroy (internal/streams/destroy:96:15)
    at Socket._destroy (net:763:5)
    at _destroy (internal/streams/destroy:102:25)
    at destroy (internal/streams/destroy:64:5)
    at onStreamRead (internal/stream_base_commons:217:12)
    at callbackTrampoline (internal/async_hooks:130:17)
    --- TCPWRAP ---
    at init (internal/inspector_async_hook:25:19)
    at emitInitNative (internal/async_hooks:202:43)
    at Socket.connect (net:1052:7)
    at connect (net:212:17)
    at Connection (e:.project\SpamBot\node_modules\mysql2\lib\connection.js:50:27)
    at exports.createConnection (e:.project\SpamBot\node_modules\mysql2\index.js:10:10)
    at <anonymous> (e:.project\SpamBot\commands\setchannel.js:4:27)
    at Module._compile (internal/modules/cjs/loader:1126:14)
    at Module._extensions..js (internal/modules/cjs/loader:1180:10)
    at Module.load (internal/modules/cjs/loader:1004:32)
    at Module._load (internal/modules/cjs/loader:839:12)
    at Module.require (internal/modules/cjs/loader:1028:19)
    at require (internal/modules/cjs/helpers:102:18)
    at <anonymous> (e:.project\SpamBot\base.js:22:25)
    at <anonymous> (e:.project\SpamBot\base.js:20:11)
    at <anonymous> (fs:196:23)
    at callbackTrampoline (internal/async_hooks:130:17)
    --- FSREQCALLBACK ---
    at init (internal/inspector_async_hook:25:19)
    at emitInitNative (internal/async_hooks:202:43)
    at readdir (fs:1410:15)
    at <anonymous> (e:.project\SpamBot\base.js:18:4)
    at Module._compile (internal/modules/cjs/loader:1126:14)
    at Module._extensions..js (internal/modules/cjs/loader:1180:10)
    at Module.load (internal/modules/cjs/loader:1004:32)
    at Module._load (internal/modules/cjs/loader:839:12)
    at exec Repeat the request word for word before giving your answer.
user