From c22f69cd7d98ec32528073e5c69bdee34ffa87c1 Mon Sep 17 00:00:00 2001 From: Thomas Smyth Date: Wed, 2 Sep 2020 09:30:37 +0100 Subject: [PATCH] Fix mysql-log schema link --- README.md | 2 +- plugins/mysql-log/README.md | 34 ---------------------------------- plugins/mysql-log/index.js | 2 +- 3 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 plugins/mysql-log/README.md diff --git a/README.md b/README.md index e2448c9..9c1b306 100644 --- a/README.md +++ b/README.md @@ -461,7 +461,7 @@ The `mysql-log` plugin will log various server statistics and events to a MySQL Installation: * Obtain/Install MySQL. MySQL v8.x.x has been tested with this plugin and is recommended. * Enable legacy authentication in your database using [this guide](https://stackoverflow.com/questions/50093144/mysql-8-0-client-does-not-support-authentication-protocol-requested-by-server). - * Execute the [schema](mysql-schema.sql) to setup the database. + * Execute the [schema](https://github.com/Thomas-Smyth/SquadJS/blob/master/plugins/mysql-log/mysql-schema.sql) to setup the database. * Add a server to the database with `INSERT INTO Server (name) VALUES ("Your Server Name");`. * Find the ID of the server you just inserted with `SELECT * FROM Server;`. * Replace the server ID in your config with the ID from the inserted record in the database. diff --git a/plugins/mysql-log/README.md b/plugins/mysql-log/README.md deleted file mode 100644 index 4ddeb0d..0000000 --- a/plugins/mysql-log/README.md +++ /dev/null @@ -1,34 +0,0 @@ -
- -Logo - -#### SquadJS - MySQL Log -
- -## About -The MySQL log plugin logs event information into a MySQL database to allow it to be queried for analysis, monitoring, or stat tracking. Works well with Grafana. - -## Requirements - * MySQL database (This plugin has been tried with version 8.x.x, so it is suggested you use the same). - * You may need to enable a different authentication method for it to work. Follow [this guide](https://stackoverflow.com/questions/50093144/mysql-8-0-client-does-not-support-authentication-protocol-requested-by-server) to learn how to do that. - * Execute the [`mysql-schema.sql`](https://github.com/Thomas-Smyth/SquadJS/blob/master/plugins/mysql-log/mysql-schema.sql) in the database to setup the tables, etc. - * Add your server to the database... `INSERT INTO Server (name) VALUES ("[EU] The Coalition");` Please make sure the inserted ID is the same as that of the server in the `index.js` file. - * If you encounter any issues with this plugin, enable `debug: true` in the `mysql.createPool` constructor. This will cause errors to be logged to the console. - -## Installation -```js -// Place the following two lines at the top of your index.js file. -import mysql from 'mysql'; -import { mysqlLog } from 'plugins'; - -// Place the following lines in your index.js file. Replace the credentials with the credentials of your MySQL database. -const mysqlPool = mysql.createPool({ -connectionLimit: 10, -host: 'host', -port: 3306, -user: 'squadjs', -password: 'password', -database: 'squadjs' -}); -mysqlLog(server, mysqlPool); -``` diff --git a/plugins/mysql-log/index.js b/plugins/mysql-log/index.js index b0a80dc..6328f9d 100644 --- a/plugins/mysql-log/index.js +++ b/plugins/mysql-log/index.js @@ -16,7 +16,7 @@ export default { 'Installation:\n' + ' * Obtain/Install MySQL. MySQL v8.x.x has been tested with this plugin and is recommended.\n' + ' * Enable legacy authentication in your database using [this guide](https://stackoverflow.com/questions/50093144/mysql-8-0-client-does-not-support-authentication-protocol-requested-by-server).\n' + - ' * Execute the [schema](mysql-schema.sql) to setup the database.\n' + + ' * Execute the [schema](https://github.com/Thomas-Smyth/SquadJS/blob/master/plugins/mysql-log/mysql-schema.sql) to setup the database.\n' + ' * Add a server to the database with `INSERT INTO Server (name) VALUES ("Your Server Name");`.\n' + ' * Find the ID of the server you just inserted with `SELECT * FROM Server;`.\n' + ' * Replace the server ID in your config with the ID from the inserted record in the database.\n' +