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

Compare with Current View Page History

« Previous Version 5 Next »

Executing custom SQL statements on the database can result in data loss or corruption. Run this procedure only when requested to do so by X-Formation Support.

To avoid data loss or corruption, we recommend that you always back up your database before performing any operations on the database.

About running a custom SQL script

 In rare cases, X-Formation Support may ask you to run a custom SQL script to fix problems with the database.

  1. You can run a custom SQL script on either an embedded database or an external database, as described below. All commands shown in the examples below use the default installation path. Adjust the commands to reflect your environment as necessary.
  2. For more details about using the mysql scripts delivered with License Statistics, see Backing up and restoring an embedded database.

Running a custom SQL script on an embedded database

If you are using an embedded MySQL database, you can run a custom SQL script using the following procedure:

  1. Create a backup of your database.
  2. Stop License Statistics.
  3. Open a terminal/console in administration mode. 
  4. Go to mysql in the License Statistics installation directory. 
    • For Windows:

      cd C:\Program Files\X-Formation\License Statistics\mysql
    • For Linux:

      cd /usr/xflicstat/mysql
  5. Start an embedded MySQL database using the mysql_start script.
    • For Windows:

      mysql_start.bat
    • For Linux:

      sh mysql_start.sh
  6. Execute the SQL script delivered to you by X-Formation Support.
    • For Windows:

      mysql.exe -hlocalhost -uroot xformation_licstat < [download_file_directory]\script.sql
    • For Linux:

      mysql -hlocalhost -uroot xformation_licstat < [download_file_directory]/script.sql
  7. Stop the embedded MySQL database using the mysql_stop script.
    • For Windows:

      mysql_stop.bat
    • For Linux:

      sh mysql_stop.sh
  8. Start License Statistics

Running a custom SQL script on an external database

If you are using an external database (recommended), you need to perform the same steps as described above for an embedded database (except steps 5 and 7), with paths and credentials adjusted for your environment.

  • No labels