This page refers to functionality that has been removed from License Statistics. Duplicate entry issues no longer exist in the current version of License Statistics.

Duplicated license server entries after migrating to License Statistics v4.6.1 database

Merging realtime data from two separate license servers under a single server was supported in versions between 4.8 and 5.13.4. Merging realtime license servers is no longer supported as of 5.14.

Inability to update UsersCount table (duplicate entry error)

A bug introduced in an older version of License Statistics can result in the embedded database index being prematurely exhausted if License Statistics is restarted too often. In such cases, there will be a problem updating the UsersCount table and you will see one or both of the following MySQL errors in the License Statistics log:

ERROR 1062 (23000) at line 1 in file: 'D:\X-Formation\License Statistics\mysql_x86\sql_query_35070.sql': Duplicate entry '65535' for key 'PRIMARY'!
[2013-03-31 01:40:03] WARNING: Unable to save concurrent hosts count to database!

FAIL: Unable to clear required tables!
MySQL error: ERROR 1062 (23000) at line 5 in file: 'D:\X-Formation\License Statistics\mysql_x86\sql_query_16.sql': Duplicate entry '65535' for key 'PRIMARY'

To resolve this problem, compact the indexes of the affected table by running the SQL commands detailed below. (Make sure you have MySQL administrator privileges: -uroot parameter. Otherwise, you will not be able to perform the steps listed below.)

  1. Shut down License Statistics (make sure xflicstat process/daemon is not running).

  2. From a command line, navigate to the License Statistics installation directory, and then to mysql_x86 for 32-bit databases or mysql_x64 for 64-bit databases. (Note that for License Statistics v4.19.1 and newer the database folder is named mysql.)

  3. Start the MySQL server by running mysql_start.bat for Windows or mysql_start.sh for Linux (make sure mysqld process/daemon is running).

  4. Connect to the License Statistics database server using the following command:
    For Windows: mysql.exe -uroot -hlocalhost --protocol=TCP
    For Linux: ./mysql -uroot -hlocalhost --socket=data/mysql.sock --protocol=TCP


  5. Check the License Statistics database location corresponds with information from below query output:
    > SELECT @@datadir;

  6. Pick the database name then (you can check it in xflicstat.cfg file, default name is xformation_licstat):
    > USE xformation_licstat

  7. Backup your data for the UsersCount table using the following SQL command:
    > SELECT Date, Total, DailyUsers, Hosts, DenialUsers INTO OUTFILE 'userscount.dump' FROM UsersCount;
     
  8. After successful backup, truncate the data and reset the index:
    > TRUNCATE UsersCount;

    > ALTER TABLE UsersCount AUTO_INCREMENT = 1;


  9. Restore the data:
    > LOAD DATA INFILE 'userscount.dump' INTO TABLE UsersCount (Date, Total, DailyUsers, Hosts, DenialUsers);

  10. Stop MySQL by running mysql_stop.bat/mysql_stop.sh

  11. Start License Statistics.

After performing these steps, the duplicate entry issues should be resolved.