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

Compare with Current View Page History

« Previous Version 4 Next »

It's potentially dangerous to execute custom SQL statements on the database and can lead to data loss or corruption. Run this procedure only when requested to do so by X-Formation Support.

We recommend that you make a backup of your database before performing any operations in order to avoid data loss or corruption.

Initial statements 

  1. In rare cases, X-Formation Support can ask to run a custom SQL script to fix some problems in the database.
  2. All example commands shown below are using the default installation path. Adjust the commands to your environment if necessary.
  3. More details about using mysql_* scripts delivered with License Statistics are available on the Backing up and restoring an embedded database page.

Running custom SQL script on EMBEDDED database

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

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

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

      cd /opt/x-formation/licstat/mysql
  5. Start embedded MySQL database using the mysql_start script
    • Windows

      mysql_start.bat
    • Linux

      sh mysql_start.sh
  6. Execute SQL script delivered by X-Formation Support
    • Windows

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

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

      mysql_stop.bat
    • Linux

      sh mysql_stop.sh
  8. Start License Statistics

Running custom SQL script on 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 5. and 7.), but with paths and credentials adjusted to your environment.

  • No labels