1 ibdata1 contents of the file:
ibdata1 is used to build a file system table innodb space, this file contains metadata innodb revoke data, modify write double buffer and buffer. If file_per_table option is turned on, then the file will not necessarily contain all the data tables. When innodb_file_per_table option turned on, then the newly created table data and index table space does not exist in the system, but the file is stored in .ibd their table.
Obviously, this document will become increasingly large, innodb_autoextend_increment option specifies the file automatically each time a step increase, the default is 8M.
2 ibdata1 increase of reasons:
ibdata1 data storage, indexing and caching, is the most important data of MYSQL. So with a growing database, the table will be greater, this can not be avoided. If a long time, more and more, we are not so easy when dealing with logs and space, I do not know where to start up. Next we deal with such a case, the sub-library to store data.
Solution 3:
a. Mysql database backup file (preferably a full backup), delete ibdata file (ibdata1, ib_logfile *), and finally re-import the data file.
Specific steps b
1. Stop Stop zabbix, do a full backup
systemctl stop zabbix-server.service
mysqldump -uroot -ppassword --all-databases --add-dorp-table > /tmp/all_mysql.sql
/tmp/all_mysql.sql (you own the appropriate directory)
2, the backup is complete, stop mysql database
systemctl stop mariadb 或者 service mysqld stop
3, modify the configuration file under Linux is MySQL configuration file my.cnf, usually on /etc/my.cnf,/etc/mysql/my.cnf
Configuration innodb_file_per_table = 1
Restart mysq, l verify that your configuration to take effect
systemctl start mariadb 或 service mysqld (re)start
4. Verify
mysql -uroot -ppassword mysql
show variables like '%per_table%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| innodb_file_per_table | ON |
+-----------------------+-------+
1 row in set (0.00 sec)
state turns ON innodb_file_per_table
5, delete files, and log ibdata1
rm -rf ibdata1
rm -rf ib_logfile*
6. Restore Mysql database
mysql -uroot -ppassword
source /tmp/all_mysql.sql
to sum up:
ibdata1 from the previous 60g, 38g goes through the above operation, the reduction reached large file required, reducing disk stress.