In a post way back in January of 2005, I discussed the software MyT
op for monitoring connections on your MySQL server. I’ve had it installed and use it semi-regularly – however, it doesn’t always work – often I am greeted with the following error:
Cannot connect to MySQL server. Please check the:
* database you specified â€œtestâ€ (default is â€œtestâ€)
* username you specified â€œrootâ€ (default is â€œrootâ€)
* password you specified â€œâ€ (default is â€œâ€)
* hostname you specified â€œlocalhostâ€ (default is â€œlocalhostâ€)
* port you specified â€œ3306â€³ (default is 3306)
* socket you specified â€œâ€ (default is â€œâ€)
The options my be specified on the command-line or in a ~/.mytop
config file. See the manual (perldoc mytop) for details.
Hereâ€™s the exact error from DBI. It might help you debug:
Unknown database â€˜testâ€™
A pain in the butt, as I get it quite regularly and normally get one of the techs to tinker with it… Here’s the fix!
Simply enter the following command:
echo â€œdb=mysqlâ€ > ~/.mytop