digdeep

凡是过去,皆是序幕。Read the fucking manual and source code.

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

mysql 的一个从库报错:

Could not execute Write_rows event on table xxx.xxxx_tmp_tj; Error writing file '/tmp/MLLGyECY' (Errcode: 28 - No space left on device), Error_code: 3; Error writing file 'mysql-bin' (errno: 28 - No space left on device), Error_code: 1026; Writing one row to the row-based binary log failed, Error_code: 1534; handler error HA_ERR_RBR_LOGGING_FAILED; the event's master log mysql-bin.003482, end_log_pos 119034357
Replicate_Ignore_Server_Ids:

df -h 查看 /tmp 目录6.3G,应该是大事务导致需要很大的临时空间,导致6.3G不够用。所以报错。

修改my.cnf, 在 [mysqld] 下面加上配置项:

tmpdir = /data/tmp 

重启mysqld.

  解决问题。

 官网文档 关于 tmpdir 的说明:

The path of the directory to use for creating temporary files. It might be useful if your default /tmp directory resides on a partition 
that is too small to hold temporary tables. This option accepts several paths that are used in round-robin fashion. Paths should be 
separated by colon characters (:) on Unix and semicolon characters (;) on Windows. If the MySQL server is acting as a replication slave, 
you should not set --tmpdir to point to a directory on a memory-based file system or to a directory that is cleared when the server host 
restarts. For more information about the storage location of temporary files, see Section B.5.3.5, “Where MySQL Stores Temporary Files”. 
A replication slave needs some of its temporary files to survive a machine restart so that it can replicate temporary tables or LOAD DATA
 INFILE operations. If files in the temporary file directory are lost when the server restarts, replication fails.

  

posted on 2020-03-03 18:27  digdeep  阅读(3428)  评论(0编辑  收藏  举报
不懂数据库和Web安全的架构师不是一个好的程序员。