mysql TRUNCATE TABLE!!!

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ponnpr7
Posts: 90
Joined: Fri Jul 28, 2017 3:55 pm

mysql TRUNCATE TABLE!!!

Post by ponnpr7 »

I was advice by one the Nagios engineer while doing the demo explaining the Nagios XI function and features. So this was the told to clear the ton of logs. I'm not really familiar with mysql, any help will be great.

mysql> echo 'TRUNCATE TABLE nagios_logentries;' | mysql -u root -p nagiosxi nagios;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the ht syntax to use near 'echo

Thanks,
Ravi Ponnaiah
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: mysql TRUNCATE TABLE!!!

Post by dwhitfield »

That command is for if you are not logged in to mysql. Since you are, you can simply run the following...assuming you are using the nagios db:

TRUNCATE TABLE nagios_logentries;

If you are not using the nagios db, just run the following command first:
use nagios;

If you logged in as root, you should have access to do this on nagios db.
ponnpr7
Posts: 90
Joined: Fri Jul 28, 2017 3:55 pm

Re: mysql TRUNCATE TABLE!!!

Post by ponnpr7 »

ok got it thanks.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: mysql TRUNCATE TABLE!!!

Post by dwhitfield »

It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!
Locked