Ibdata1 filling up disk space

Appreciate it. Dumping the asteriskcdrdb database after having deleted CEL data older than 6 months was only 740 mb. If it grows really quick again I’ll look into storing it remotely.

In the interest of having it fully documented for anyone else like me that isnt as versed in mysql as maybe they could be

First create copies of the databases from the CLI. If you want to trim down the CEL table you can do that first.

cd /var/lib/mysql
mysqldump asteriskcdrdb > asteriskcdrdb.sql;
mysqldump asterisk > asterisk.sql;

then log into myqsl and drop the databases

mysql
DROP DATABASE asterisk;
DROP DATABASE asteriskcdrdb;

Then stop mysql, the command is now service mariadb stop

Delete the ibdata1 and the two log files

Restart mariadb using service mariadb restart , this also takes a long while (like 2 minutes)

Then in the CLI (not logged into mysql) load the tables you backed up

mysql asteriskcdrdb < asteriskcdrdb.sql
mysql asterisk < asterisk.sql

2 Likes