** BACKUP DATA FILES AND CONFIG BEFORE USING **
If you want to use the SQL feature there are 2 ways to set this up, so before making any changes you need to choose how you want to use this option. You must put your database information in the config file and reload the mod before it will be able to connect to an SQL database:
Choose which way you want the mod to use SQL:
** DO NOT SET (Data Type = 1) AND (Use SQL Database = false), PLUGIN WILL NOT LOAD UNTIL PROPERLY SET **
1. Default DataFile with SQL Save:
Uses the default datafile to load and save all records as normal but also saves the data to SQL for other usage. This option is mainly for retrieving the data outside the server similar to webrequests. If you have a dedicated server with a website on the same host or if your SQL allows external connection this would be the fastest way to save and load records to display them outside the game instead of using webrequests. You can still use webrequests if you choose.
Configuration Settings:
**IMPORTANT**
If you choose SQL only and you already have player data saved in the datafile then before switching over to SQL only you should use option 1 (DataFile with SQL Save) first so that it will load all current player data and save it to the SQL. You can also run the chat command (/krsql checkall) once to make sure it does this. Check your database to make sure it connected and all the data has in fact been saved. Then switch to option 2 below. If you do not do this it will not retrieve current player data once you enable SQL only!
2. SQL only
This options will use the SQL database to save and load all records and disable datafile saving/loading. It will only save to the datafile as a backup when plugin is unloaded or server shuts down. This will greatly decrease server load for high traffic servers when saving/loading data compaired to saving to a datafile. This option comes with risks, in the event that for some reason the SQL host becomes unreachable it could cause record loss.
Configuration Settings:
If you want to use the SQL feature there are 2 ways to set this up, so before making any changes you need to choose how you want to use this option. You must put your database information in the config file and reload the mod before it will be able to connect to an SQL database:
"SQL Host": "HOSTNAME", // Name or address of the host that the SQL is located
"SQL Port": 3306, // Port that the SQL host allows connection through
"SQL Database": "DATABASE NAME", // Name of the main database the mod will create a table in
"SQL Username": "DATABASE USERNAME", // Username for accessing the SQL host
"SQL Password": "DATABASE PASSWORD" // Password for accessing the SQL host
Choose which way you want the mod to use SQL:
** DO NOT SET (Data Type = 1) AND (Use SQL Database = false), PLUGIN WILL NOT LOAD UNTIL PROPERLY SET **
1. Default DataFile with SQL Save:
Uses the default datafile to load and save all records as normal but also saves the data to SQL for other usage. This option is mainly for retrieving the data outside the server similar to webrequests. If you have a dedicated server with a website on the same host or if your SQL allows external connection this would be the fastest way to save and load records to display them outside the game instead of using webrequests. You can still use webrequests if you choose.
Configuration Settings:
"Use SQL Database": true,
"Data Type (UseDataFile = 0, UseSQL = 1)": 0,
**IMPORTANT**
If you choose SQL only and you already have player data saved in the datafile then before switching over to SQL only you should use option 1 (DataFile with SQL Save) first so that it will load all current player data and save it to the SQL. You can also run the chat command (/krsql checkall) once to make sure it does this. Check your database to make sure it connected and all the data has in fact been saved. Then switch to option 2 below. If you do not do this it will not retrieve current player data once you enable SQL only!
2. SQL only
This options will use the SQL database to save and load all records and disable datafile saving/loading. It will only save to the datafile as a backup when plugin is unloaded or server shuts down. This will greatly decrease server load for high traffic servers when saving/loading data compaired to saving to a datafile. This option comes with risks, in the event that for some reason the SQL host becomes unreachable it could cause record loss.
Configuration Settings:
"Use SQL Database": true,
"Data Type (UseDataFile = 0, UseSQL = 1)": 1,