While accessing the MIB tools getting an unexpected error stating "Could not initialize MySQL connection"
The OneClick log file catalina.out (Linux) | stdout.log (Windows) shows the following errors
------------------------------------------------------------------------------------------
Could not initialize MySQL connection, retry in 5 seconds: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
- WARNING: Tomcat not started yet
- Could not initialize MySQL connection, retry in 5 seconds: Communications link failure
------------------------------------------------------------------------------------------
Release : 20.x, 21.x,22.x
Component : SpectroSERVER
It appears that on occasion MySQL does not start properly or that OneClick starts faster than mysqld daemon process
Stop OneClick and Processd, verify the mysqld daemon is no longer running, start processd, start OneClick tomcat.
Windows Click here
Linux Click here
- stop tomcat
cd $SPECROOT/tomcat/bin/
./stopTomcat.sh
As the root user
- stop processd
systemctl stop processd
- wait a few seconds and make sure that mysqld is no longer running
ps -ef | grep mysqld
- start processd
systemctl start processd
Verify that the mysqd daemon is started
ps -ef | grep mysqld
Processd should also start OneClick tomcat, if for some reason it does not you can manually start
it as the spectrum user
- as the spectrum user
cd $SPECROOT/tomcat/bin/
./startTomcat.sh
STEPS FOR WINDOWS:
- Launch the Windows Services Control Panel
- Stop the 'SpectrumTomcat' Service
- Stop the 'SPECTRUM Process Daemon' service
- In Task Manager, verify that the mysqld.exe process is no longer running (in case of a hung mysql process)
- Start the 'SPECTRUM Processd Daemon' service
- Start the 'SpectrumTomcat' Service
Alternatively, rebooting the system should also correct this.