# How to purge the MySQL General Log file?

**URL:** <https://forum.inductiveautomation.com/t/how-to-purge-the-mysql-general-log-file/57393>\
**Category:** Ignition\
**Created:** [March 19, 2022, 10:18pm UTC](https://forum.inductiveautomation.com/t/how-to-purge-the-mysql-general-log-file/57393 "2022-03-19T22:18:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 19, 2022, 10:18pm UTC](https://forum.inductiveautomation.com/t/how-to-purge-the-mysql-general-log-file/57393/1 "2022-03-19T22:18:23Z")

</div>

The MySQL general log has grown to 325 GB. I’m not going to read it all so I’d like to get my disk back.

What’s the procedure for this? I presume that I’ll have to at least stop the MySQL service. Do I need to stop Ignition as well or can I leave it running (while I stop MySQL) and avail of Store and Forward to avoid missing any records?

Many thanks.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [March 19, 2022, 11:43pm UTC](https://forum.inductiveautomation.com/t/how-to-purge-the-mysql-general-log-file/57393/2 "2022-03-19T23:43:34Z")

</div>

From what i read, you would first need to turn the general log off then truncate the log. I haven’t actually done this before, so take it with a grain of salt.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 20, 2022, 8:03am UTC](https://forum.inductiveautomation.com/t/how-to-purge-the-mysql-general-log-file/57393/3 "2022-03-20T08:03:29Z")

</div>

Thanks.  
I used instructions from [5 MySQL Database Logs to Keep an Eye On - Coralogix](https://coralogix.com/blog/5-essential-mysql-database-logs-to-keep-an-eye-on/).  
From the Windows CMD prompt change to the MySQL program folder. Type  
`mysql -u root -p` and enter the password when prompted.  
At the mysql prompt type  
`mysql>SET GLOBAL general_log = ‘OFF’;`  
This seems to have stopped the logger _and_ deleted the file.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 20, 2022, 12:10pm UTC](https://forum.inductiveautomation.com/t/how-to-purge-the-mysql-general-log-file/57393/4 "2022-03-20T12:10:11Z")

</div>

You probably don’t want to turn it completely off. That makes future troubleshooting difficult. Can MySQL not do its own log rotation?
