Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
png
insert_methods.png 112.2 kB 1 29-Dec-2020 05:25 krivacsz
jpg
sql_stats1.jpg 163.2 kB 1 29-Dec-2020 05:25 Ada Csaba

This page (revision-42) was last changed on 17-Nov-2023 16:11 by Ada Csaba

This page was created on 29-Dec-2020 05:25 by Ben Spink

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 1 added 3 lines
__IMPORTANT: due to the security updates since CrushFTP version 10.5.2+ any JDBC driver jar file needs to be placed into the CrushFTP10/plugins/lib/ directory, or it won't load.__
\\
\\
At line 2 removed 2 lines
[https://dev.mysql.com/downloads/connector/j/5.1.html]
At line 5 changed one line
Direct link: [https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.47.zip]
[https://dev.mysql.com/downloads/connector/j/]
At line 7 changed 2 lines
Alternatively, can browse the Maven repository for the appropriate JDBC drive matching your SQL server version, if not using the latest build of it
[https://mvnrepository.com/artifact/mysql/mysql-connector-java]
Choose the 'platform independent' type download, and extract the archive. There will be a jar file inside that extracted folder.
At line 10 changed one line
I suggest placing the mysql-connector-java-5.0.8-bin.jar file from this in the plugins/lib folder of CrushFTP and giving it the name "mysql.jar".
I suggest placing the mysql-connector-java-8.0.28.jar file from this in the plugins/lib folder of CrushFTP and giving it the name "mysql.jar".
At line 18 changed one line
stats_db_driver: com.mysql.jdbc.Driver
stats_db_driver: com.mysql.cj.jdbc.Driver
At line 21 changed 4 lines
}}}
Use MySQL Workbench and make a new DB with the name "crushftp_stats" (or adjust the URL above to reference the name you choose.) Below is the schema to put in it:
}}}\\
\\
Use MySQL Workbench and make a new DB with the name "crushftp_stats" (or adjust the URL above to reference the name you choose.) Below is the schema to put in it:\\
\\
At line 34 changed one line
}}}
}}}\\
\\
That is it. Now the statistics data should be going to the MySQL tables, and reports will automatically run against those tables too.\\
\\
!! Setup Auto increment primary keys
\\
1. On prefs.XML (find it at CrushFTP install folder) change the tag value "__stat_auto_increment__" to __true__.\\
\\
2. Change the RID column (on META_INFO, SESSIONS and TRANSFERS table) to be auto incremented and data type from DOUBLE to BIGINT.\\
\\
{{{
ALTER TABLE `META_INFO` CHANGE COLUMN `RID` `RID` BIGINT(20) NOT NULL AUTO_INCREMENT;
At line 36 changed one line
That is it. Now the statistics data should be going to the MySQL tables, and reports will automatically run against those tables too.
ALTER TABLE `SESSIONS` CHANGE COLUMN `RID` `RID` BIGINT(20) NOT NULL AUTO_INCREMENT;
ALTER TABLE `TRANSFERS` CHANGE COLUMN `RID` `RID` BIGINT(20) NOT NULL AUTO_INCREMENT;
}}}\\
\\
3. Adjust insert queries. Remove the __RID__ value from all insert query.\\
\\
[attachments|insert_methods.png]\\
\\
Change __stats_insert_meta_info__ from:\\
{{{
INSERT INTO META_INFO (RID, SESSION_RID, TRANSFER_RID, ITEM_KEY, ITEM_VALUE) VALUES (?,?,?,?,?)
}}}\\
to:\\
{{{
INSERT INTO META_INFO (SESSION_RID, TRANSFER_RID, ITEM_KEY, ITEM_VALUE) VALUES (?,?,?,?)
}}}\\
\\
__stats_insert_sessions__ from:\\
{{{
INSERT INTO SESSIONS (RID, SESSION, SERVER_GROUP, USER_NAME, START_TIME, END_TIME, SUCCESS_LOGIN, IP) VALUES (?,?,?,?,?,?,?,?)
}}}\\
to:\\
{{{
INSERT INTO SESSIONS (SESSION, SERVER_GROUP, USER_NAME, START_TIME, END_TIME, SUCCESS_LOGIN, IP) VALUES (?,?,?,?,?,?,?)
}}}\\
\\
__stats_insert_transfers__ from:\\
{{{
INSERT INTO TRANSFERS (RID, SESSION_RID, START_TIME, DIRECTION, PATH, FILE_NAME, URL, SPEED, TRANSFER_SIZE, IGNORE_SIZE) VALUES (?,?,?,?,?,?,?,?,?,'N')
}}}\\
to:\\
{{{
INSERT INTO TRANSFERS (SESSION_RID, START_TIME, DIRECTION, PATH, FILE_NAME, URL, SPEED, TRANSFER_SIZE, IGNORE_SIZE) VALUES (?,?,?,?,?,?,?,?,'N')
}}}\\
Version Date Modified Size Author Changes ... Change note
42 17-Nov-2023 16:11 3.9 kB Ada Csaba to previous
41 17-Nov-2023 16:11 3.894 kB Ada Csaba to previous | to last
« This page (revision-42) was last changed on 17-Nov-2023 16:11 by Ada Csaba
G’day (anonymous guest)
CrushFTP10 | What's New

Referenced by
General Settings

JSPWiki