The table is full problem solving process

The table'xxxx'is full Set the size of the temporary table: http://blog.csdn.net/a351945755/article/details/23454671
The solution for The table is full in MySQL: https://my.oschina.net/longjianghu /blog/162960
     When performing a data insertion operation today, the program throws Cause: java.sql.SQLException: The table 'tb_logs' is full exception. I read the relevant article and said that it is the time of MySQL temporary space and heap space. Just try to delete some data, truncate table tb_logs, throw table doesn't exist, execute any command without response, so modify the configuration according to the prompts in related articles
tmp_table_size = 32M
max_heap_table_size = 32M

There is no response to restarting mysql, check the mysql error log,
Donad_Draper:/home2/mysql # view -f mysqld.log
2017-05-05 18:11:21 28045 [Note] Server socket created on IP: '::'.
2017-05-05 18:11:21 28045 [ERROR] /usr/sbin/mysqld: Error writing file '/mysqldata/Donad_Draper.pid' (Errcode: 28 - No space left on device)
2017-05-05 18:11:21 28045 [ERROR] Can't start server: can't create PID file: No space left on device
170505 18:13:38 mysqld_safe Starting mysqld daemon with databases from /mysqldata
2017-05-05 18:13:38 f74316d0 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED.
This option may be removed in future releases, together with the option innodb_use_sys_malloc
and with the InnoDB's internal memory allocator.

From the log, it is the reason that the disk space is not enough, check the disk space,

Donad_Draper:/mysqldata # df  -lh
Filesystem                             Size  Used Avail Use% Mounted on
/dev/disksafe/sda3                      32G   17G   14G  56% /
udev                                   3.9G  132K  3.9G   1% /dev
tmpfs                                   12G   76K   12G   1% /dev/shm
/dev/disksafe/sda1                     189M  127M   53M  71% /boot
/dev/mapper/vg_mysqldata-lv_mysqldata   30G   30G     0 100% /mysqldata


Sure enough, the reason for the full disk space, because the system department is not there, we will not expand the disk space, and I want to solve the problem quickly, and I don't want to leave it in next week, so I used the stupidest method to remove some unnecessary databases. Physical files,
view the mysql data directory:
Donad_Draper:/mysqldata # ls
auto.cnf      area_data3       ibdata1          area_data1           mysql-bin.index     area_data5
dls_databack  ib_logfile0  Donad_Draper.pid  mysql             performance_schema  area_data4
area_data2      ib_logfile1  lost+found       mysql-bin.000001  center_data

Donad_Draper:/mysqldata #du -sh *  
4.0K    auto.cnf
22G     dls_databack
16M     area_data2
1.1G    area_data3
49M     ib_logfile0
49M     ib_logfile1
13M     ibdata1
4.0K    Donad_Draper.pid
4.0K    lost+found
16M     area_data1
2.2M    mysql
4.0K    mysql-bin.000001
4.0K    mysql-bin.index
636K    performance_schema
5.0M    area_data4
16M     area_data5
6.3G    center_data



Since the center_data library is an obsolete database, move this physical file to another disk

Donad_Draper: / mysqldata # mv center_data / home2 / bak /
Donad_Draper:/mysqldata #

Donad_Draper:/mysqldata # df -lh
Filesystem                             Size  Used Avail Use% Mounted on
/dev/disksafe/sda3                      32G   19G   12G  62% /
udev                                   3.9G  132K  3.9G   1% /dev
tmpfs                                   12G   76K   12G   1% /dev/shm
/dev/disksafe/sda1                     189M  127M   53M  71% /boot
/dev/mapper/vg_mysqldata-lv_mysqldata   30G   24G  4.8G  84% /mysqldata
Donad_Draper:/mysqldata #  


After restarting the database, it is ready to use.
So the next time the problem of The table 'tb_logs' is full occurs, first check whether the disk space is full and check the server status:
mysql> show status;
+-----------------------------------------------+-------------+
| Variable_name                                 | Value       |
+-----------------------------------------------+-------------+
| Aborted_clients                               | 0           |
| Aborted_connects                              | 0           |
| Binlog_cache_disk_use                         | 0           |
| Binlog_cache_use                              | 0           |
| Binlog_stmt_cache_disk_use                    | 0           |
| Binlog_stmt_cache_use                         | 0           |
...
 Ssl_cipher                                    |             |
| Ssl_cipher_list                               |             |
| Ssl_client_connects                           | 0           |
| Ssl_connect_renegotiates                      | 0           |
| Ssl_ctx_verify_depth                          | 0           |
| Ssl_ctx_verify_mode                           | 0           |
| Ssl_default_timeout                           | 0           |
| Ssl_finished_accepts                          | 0           |
| Ssl_finished_connects                         | 0           |
| Ssl_server_not_after                          |             |
| Ssl_server_not_before                         |             |
| Ssl_session_cache_hits                        | 0           |
| Ssl_session_cache_misses                      | 0           |
| Ssl_session_cache_mode                        | NONE        |
| Ssl_session_cache_overflows                   | 0           |
| Ssl_session_cache_size                        | 0           |
| Ssl_session_cache_timeouts                    | 0           |
| Ssl_sessions_reused                           | 0           |
| Ssl_used_session_cache_entries                | 0           |
| Ssl_verify_depth                              | 0           |
| Ssl_verify_mode                               | 0           |
| Ssl_version                                   |             |
| Table_locks_immediate                         | 98          |
| Table_locks_waited                            | 0           |
| Table_open_cache_hits                         | 1           |
| Table_open_cache_misses                       | 41          |
| Table_open_cache_overflows                    | 40          |
| Tc_log_max_pages_used                         | 0           |
| Tc_log_page_size                              | 0           |
| Tc_log_page_waits                             | 0           |
| Threads_cached                                | 0           |
| Threads_connected                             | 7           |
| Threads_created                               | 7           |
| Threads_running                               | 2           |
| Uptime                                        | 510         |
| Uptime_since_flush_status                     | 510         |
+-----------------------------------------------+-------------+
341 rows in set

There is nothing wrong with the server status, when viewing the table status:
mysql> show table status where name='tb_logs';
+-----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+------------+
| Name      | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation       | Checksum | Create_options | Comment    |
+-----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+------------+
| tb_logs | InnoDB | 10 | Compact | 3 | 5461 | 16384 | 0 | 16384 | 0 | 32328 | 2017-05-05 19:02:13 | NULL | NULL | utf8_general_ci | NULL | |
+-----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+------------+
1 row in set

mysql>

If it is the reason for too many rows, modify the table MAX_ROWS:
ALTER TABLE tb_logs MAX_ROWS=1000000000;

This is not recommended.


Otherwise, check the size of mysql temporary space and heap space
mysql> SHOW VARIABLES WHERE Variable_name LIKE '%table_size%';
+---------------------+----------+
| Variable_name       | Value    |
+---------------------+----------+
| max_heap_table_size | 16777216 |
| tmp_table_size      | 16777216 |
+---------------------+----------+
2 rows in set


If it is a space problem, modify the relevant configuration:

Donad_Draper:/home/fsjrfw # vim /etc/my.cnf
# The MySQL server
[mysqld]
tmp_table_size = 32M
max_heap_table_size = 32M
:wq

Reboot:

mysql> SHOW VARIABLES WHERE Variable_name LIKE '%table_size%';
+---------------------+----------+
| Variable_name       | Value    |
+---------------------+----------+
| max_heap_table_size | 33554432 |
| tmp_table_size      | 33554432 |
+---------------------+----------+
2 rows in set
mysql>











Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326290113&siteId=291194637