You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

The information on this page refers to License Statistics v6.0 and newer, which introduced a new user interface (UI). If you are using a version previous to v6.0, see documentation for previous versions.

You can query the database for additional usage data using the UI or at a command line, as described below. The reference to the MySQL database is stored in htdocs/application/data/sql/database_structure.sql.

Generating SQL reports using the UI

To run a SQL query on the License Statistics database using the UI:

  1. Log into License Statistics as an administrator.

  2. Select the SQL Console page under the Administration section in the left navigation pane. 

  3. Enter your SQL query in the "SQL Query" text box and click Execute to generate the report.

    The results will be returned in a grid only if you enter a query that returns data; e.g., SELECT or SHOW.
  4. If desired, click Save to save the query. A dialog will allow you to name the query. You can also edit the query if needed by changing the entry in the SQL Query edit box.



  5. After saving the query, it will be available from the Saved Queries grid.


Exporting query data

You can export the data returned from the query by clicking on one of the options under Save As at the bottom right of the Query Results grid. For example, you may want to view the report in Excel or PDF so you can include it in a report or presentation. See Downloading License Statistics data for more information about obtaining data in various formats.

Use caution when running queries that use UPDATE or DELETE keywords, because using these keywords can cause data loss or corruption.

The default query limit is 1000 rows. It can be overwritten using LIMIT keyword in the SQL statement.

Running a SQL query from a command line

To run a SQL query from a command line:

  1. Stop License Statistics.

  2. From a command line, navigate to the License Statistics installation directory, and then to mysql_x64 for 64-bit databases (mysql for License Statistics v4.19.1 and newer).

  3. Start the MySQL server by running mysql_start.bat for Windows or mysql_start.sh for Linux.

  4. Connect to the License Statistics database using the following command:

    For Windows: mysql -u root -h localhost -tcp -Dxformation_licstat
    For Linux: ./mysql -u root -h localhost -tcp -Dxformation_licstat --socket=data/mysql.sock

  5. After connecting to the database, run the desired MySQL commands.

  6. Stop the MySQL server by running mysql_stop.bat for Windows or mysql_stop.sh for Linux.

  7. Restart License Statistics.


  • No labels