How do I repair a damaged MySQL database?


Webtrends Analytics 8.1x
Webtrends Analytics 8.0x
Webtrends Enterprise 7.x
Webtrends Professional 7.x
Webtrends Small Business 7.x


For a variety of reasons, the MySQL database can become damaged and require repair. Symptoms of a damaged database in Webtrends can include stalled jobs, jobs that won’t enter the queue, and failed analysis.


To repair or check the integrity of a MySQL database, follow the instructions below:

1. Webtrends services must be stopped in the correct order to ensure proper connectivity between modules in the application. Use the order below to prevent any possible issues.

“Webtrends – Scheduler Agent”
“Webtrends – User Interface”
“Webtrends – Express Analysis Engine”
“Webtrends – Express Data Mover”
“Webtrends – Report Cache Server”
“Webtrends – GeoTrends”
“Webtrends – Email Notification Service”
“Webtrends – System Monitor”

Note: Not all of the services listed above may be present on the system. Also, the “Webtrends – Apache” and “Webtrends – Tomcat” will stop and start in conjunction with the “Webtrends – User Interface” service, and therefore should not require being stopped or started.

2. Open a command line window on the Webtrends server and navigate to the following folder:


3. Type the following command:

mysqlcheck.exe -r –databases wt_sched -u -p

Replace with the username chosen for the MySQL database at the time of installation. This is “Administrator” by default.
Replace with the password chosen for the MySQL database at the time of installation, and omit the space between -p and the password. This will display the password on the line above, instead of prompting for it and hiding it after hitting Enter. By displaying it above it can be verified that no mistakes are made when entered.

Note: The MySQL username and password are not the same as Windows or Webtrends authentication credentials. If the username and password are not available, contact Webtrends Technical Support at (503) 223-3023.

After the above command has been entered successfully a list of databases tables will display, indicating a status of “OK” for each line. In some cases, a line may indicate that the table has changed, in other cases, each line may display “OK” but the database repair utility may pause momentarily while it repairs the table. This is the expected behavior, indicating that the utility is having an effect on the database.

4. Run the above command a second time. This is an incremental correction, so running two or even three passes on each part of the database can be helpful to resolve issues that may not be corrected the first time. Repeat this command until the tool completes almost immediately.

5. Type the following command:

mysqlcheck.exe -r –databases wtmaster -u -p

Note: The wtmaster part of the the database does not contain an underscore in the name. If errors are received when running this command verify the spelling is correct.

As before, repeat this command until the tool completes almost immediately.

For a list of all command options for mysqlcheck.exe, type mysqlcheck without arguments at the command prompt in the directory specified above.

6. Restart the Webtrends services in the following order:

“Webtrends ? MySQL” (restart)
“Webtrends – System Monitor”
“Webtrends – Email Notification Service”
“Webtrends – GeoTrends”
“Webtrends – Report Cache Server”
“Webtrends – Express Data Mover”
“Webtrends – Express Analysis Engine”
“Webtrends – User Interface”
“Webtrends – Scheduler Agent”

More Information

MySQL databases can be damaged by the following processes, configurations, and events:

  • Disk defragmentation utilities
  • Windows Indexing service
  • Backup utilities
  • Antivirus and scriptblocking applications
  • Any other application or service that touches files within the Webtrends installation and storage folder, which can result in the locking of files
  • Improperly configured installations, such as having too many custom reports or running Webtrends in a virtual environment
  • Hardware failures, bottlenecks, or insufficient resources
  • Power outages and hard server resets
For more information about how MySQL databases can become corrupted, refer to How do I repair a damaged MySQL database?