# Database run up to 1GB! Issue

**URL:** <https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976>\
**Category:** Product Support\
**Created:** [March 2, 2016, 5:40pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976 "2016-03-02T17:40:12Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miracle\_maker](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Miracle\_maker](https://forum.mautic.org/u/Miracle_maker)\
**Post date:** [March 2, 2016, 5:40pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/1 "2016-03-02T17:40:12Z")

</div>

Guys, i have unexpected problem with one mautic installation. Can you help me with this?  
  
  
  
It turns out that my table email\_copies in the database is increasing rapidly to about 700 МВ. And some other as well. This does not look to me normal. Can someone help me to resolve it?

---

<div class="post-metadata">

**Author:** ![Miracle\_maker](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Miracle\_maker](https://forum.mautic.org/u/Miracle_maker)\
**Post date:** [March 2, 2016, 5:40pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/2 "2016-03-02T17:40:12Z")

</div>

Guys, i have unexpected problem with one mautic installation. Can you help me with this?

It turns out that my table email\_copies in the database is increasing rapidly to about 700 МВ. And some other as well. This does not look to me normal. Can someone help me to resolve it?

---

<div class="post-metadata">

**Author:** ![Miracle\_maker](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Miracle\_maker](https://forum.mautic.org/u/Miracle_maker)\
**Post date:** [March 2, 2016, 5:45pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/3 "2016-03-02T17:45:17Z")

</div>

My biggest tables are as follows:

```
email_copies	~19,270 raws - 712.6 MiB	-
email_stats ~25,244 raws - 99.1 MiB	-
page_hits ~82,405 raws -	64.6 MiB	-
audit_log ~84,597 raws - 29.6 MiB	-
campaign_lead_event_log	~80,341 raws - 21 MiB	-
ip_addresses	~28,044 raws - 19 MiB	-

```

I have only 6000 leads. How do i clear them or reduce the size? Thanks in advance,

---

<div class="post-metadata">

**Author:** ![Miracle\_maker](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Miracle\_maker](https://forum.mautic.org/u/Miracle_maker)\
**Post date:** [March 2, 2016, 5:57pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/4 "2016-03-02T17:57:28Z")

</div>

What would happen if i empty the table?

---

<div class="post-metadata">

**Author:** ![alfonso](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@alfonso](https://forum.mautic.org/u/alfonso)\
**Post date:** [March 2, 2016, 6:15pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/5 "2016-03-02T18:15:16Z")

</div>

Have you tried to go to phpmyadmin and optimize each table. I don’t think It resolve the problem but you can get some space…

---

<div class="post-metadata">

**Author:** ![DonGilbert](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dongilbert/32/1735_2.png) [@DonGilbert](https://forum.mautic.org/u/DonGilbert)\
**Post date:** [March 2, 2016, 7:29pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/6 "2016-03-02T19:29:20Z")

</div>

The way I understand it, Mautic keeps copies of your email for the web view links. To reduce the size, you could remove all rows whose creation date is greater than 2 months (or whatever arbitrary date range you want to choose), that way you’re not keeping really old email copies that probably don’t need to be kept any longer.

We’re considering putting in the ability to purge old entries from these tables.

---

<div class="post-metadata">

**Author:** ![pietromantovani](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pietromantovani](https://forum.mautic.org/u/pietromantovani)\
**Post date:** [October 7, 2016, 9:42am UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/7 "2016-10-07T09:42:17Z")

</div>

Hi @DonGilbert, “We’re considering putting in the ability to purge old entries from these tables.” any news on that? My email\_stats table is 1,2Gb! I’m also experiencing high Mysql CPU usage, I wonder if this big tables could be the problem.  
Thanks

---

<div class="post-metadata">

**Author:** ![eplaku](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/eplaku/32/49_2.png) [@eplaku](https://forum.mautic.org/u/eplaku)\
**Post date:** [April 26, 2017, 9:40am UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/8 "2017-04-26T09:40:19Z")

</div>

+1

---

<div class="post-metadata">

**Author:** ![bunce69](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bunce69/32/143_2.png) [@bunce69](https://forum.mautic.org/u/bunce69)\
**Post date:** [September 18, 2017, 5:43pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/9 "2017-09-18T17:43:37Z")

</div>

I have the same issue.

What can I delete? My biggest table is audit\_log.

What is this useful to? Can I delete everything? Will it delete my leads datas (as first name, last name…) or just the email copies and unuseful datas?

By the way, which mysql request can I apply to make an automation to delete unuseful datas regulary.

Thanks for your reply.

---

<div class="post-metadata">

**Author:** ![bunce69](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bunce69/32/143_2.png) [@bunce69](https://forum.mautic.org/u/bunce69)\
**Post date:** [September 18, 2017, 5:45pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/10 "2017-09-18T17:45:16Z")

</div>

I have as well page hits which 250Mb

What can I delete and what is useful with all the tables.

---

<div class="post-metadata">

**Author:** ![ninjoan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ninjoan/32/1005_2.png) [@ninjoan](https://forum.mautic.org/u/ninjoan)\
**Post date:** [September 18, 2017, 6:31pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/11 "2017-09-18T18:31:05Z")

</div>

Cleaning out old data  
WARNING: this is a destructive process which will result in deletion of data

This cron job allows you to clean out old data - note that not all data can be purged with this task. Currently supported are audit log entries, visitors (anonymous contacts), and visitor page hits. Use –dry-run to view the number of records to be purged before making any changes. This will permanently delete data! Be sure to keep database backups.

`
path/to/php /path/to/mautic/app/console mautic:maintenance:cleanup --days-old=365 --dry-run`

---

<div class="post-metadata">

**Author:** ![bunce69](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bunce69/32/143_2.png) [@bunce69](https://forum.mautic.org/u/bunce69)\
**Post date:** [September 19, 2017, 8:52am UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/12 "2017-09-19T08:52:50Z")

</div>

Thk you mate 🙂

---

<div class="post-metadata">

**Author:** ![bunce69](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bunce69/32/143_2.png) [@bunce69](https://forum.mautic.org/u/bunce69)\
**Post date:** [September 20, 2017, 12:18pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/13 "2017-09-20T12:18:14Z")

</div>

Arf, I have access denied.

My host say it’s because of the htaccess do you know something about it?

I really drive crazy with this software, nothing works!

---

<div class="post-metadata">

**Author:** ![bunce69](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bunce69/32/143_2.png) [@bunce69](https://forum.mautic.org/u/bunce69)\
**Post date:** [September 20, 2017, 12:31pm UTC](https://forum.mautic.org/t/database-run-up-to-1gb-issue/5976/14 "2017-09-20T12:31:40Z")

</div>

I have access denied…is there a mysql command that I could try through phpmyadmin?
