MySQL临时表创建出错(OS errno 13 - Permission denied)

一个客户向我抱怨:在MySQL查询小表没有问题,查询大表出错,下面是他发给我的出错的部分截屏(客户的表名被我隐藏了)。

在这里插入图片描述

这里的给出的信息已经比较明显了,是向/tmp目录中创建临时表失败(临时表的路径是由系统变量tmpdir决定的,默认在/tmp目录中),小表不需要用到临时表就没有问题,我登录上去检查一下MySQL的错误日志,发现有下面的记录:

2024-01-27T09:31:14.059966Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-000001 - Can't create/write to file '/tmp/ib9IqGPN' (OS errno 13 - Permission denied)
2024-01-27T09:31:14.060056Z 0 [ERROR] [MY-012792] [InnoDB] Cannot create temporary merge file
2024-01-27T09:32:22.698498Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-000001 - Can't create/write to file '/tmp/ibuFD5pG' (OS errno 13 - Permission denied)
2024-01-27T09:32:22.698617Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-000001 - Can't create/write to file '/tmp/ibJyUu0y' (OS errno 13 - Permission denied)
2024-01-27T09:32:22.698786Z 0 [ERROR] [MY-012792] [InnoDB] Cannot create temporary merge file
2024-01-27T09:32:22.698783Z 0 [ERROR] [MY-012792] [InnoDB] Cannot create temporary merge file24-01-27T09:30:06.361749Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-000001 - Can't create/write to file '/tmp/ibivRI0I' (OS errno 13 - Permission denied)
2024-01-27T09:30:06.361920Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-000001 - Can't create/write to file '/tmp/ibx78TGm' (OS errno 13 - Permission denied)
2024-01-27T09:30:06.361864Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-000001 - Can't create/write to file '/tmp/ibdcjrzB' (OS errno 13 - Permission denied)
2024-01-27T09:30:06.361955Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-000001 - Can't create/write to file '/tmp/iblFGa8t' (OS errno 13 - Permission denied)

看来是/tmp目录的权限出了问题,检查一下:

oracle@Scott ~$ ll -ld /tmp
drwxrwxrwt. 11 root root 4096 Jan 29 09:22 /tmp
oracle@Scott ~$[root@oracle data]# ll -ld /tmp
drwxr-xr-x. 70 root root 630784 Jan 29 09:40 /tmp

发现权限不足,而且居然没有粘滞位(Sticky bit),粘滞位是Unix文件系统权限的一个旗标。最常见的用法在目录上设置粘滞位,如此以来,只有目录内文件的所有者或者root才可以删除或移动该文件。如果不为目录设置粘滞位,任何具有该目录写和执行权限的用户都可以删除和移动其中的文件。实际应用中,粘滞位一般用于/tmp目录,以防止普通用户删除或移动其他用户的文件。使用下面的命令对tmp目录进行修改:

sudo chmod 1777 /tmp 

然后故障排除😀

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/529446.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

多核多cluster多系统之间缓存一致性概述

目录 1.思考和质疑2.怎样去维护多核多系统缓存的一致性2.1多核缓存一致性2.2多Master之间的缓存一致性2.3dynamIQ架构同一个core中的L1和L2 cache 3.MESI协议的介绍4.ACE维护的缓存一致性5.软件定义的缓存和替换策略6.动图示例 本文转自 周贺贺,baron,代…

基于4G的水质参数远程监测系统研究

基于4G的水质参数远程监测系统研究 摘 要 近年来随着我国经济飞速的发展,对水资源的破坏也日益严重。无论是生活需求用水还是工业废水的处理都存在这严重问题,由于水质净化技术的不成熟,对水质监测的实时性存在着很大的缺陷,水污…

Aspose.Words指定位置插入table

如果在创建书签,然后在书签位置插入表格,会出现格式错乱,在单元格位置里面有一个表格,不符合实际使用。正确做法是复制模板文件里面的表格行,然后插入若干行。 如图标记红色位置插入动态数据行,是先复制标…

基于springboot+vue的汽车改装方案网站(源码+论文)

目录 前言 一、功能设计 二、功能实现 三、库表设计 四、论文 前言 对于当今社会发展趋势越来越迅猛,传统汽车改装模式的没落,我认为这并不是不能避免的,但说实话,现在的生活方式与以往相比有太大的改变,人们的娱乐方式不仅仅再是读书看报。由于近些…

简单了解TCP/IP四层模型

什么是计算机网络? 计算机网络我们可以理解为一个巨大的城市地图,我们想从A地前往B地,其中要走的路、要避开的问题都交给计算机网络解决,直到我们可以正常的到达目的地,那么我们会把其中的过程抽象成一个网络模型&…

Power Design【数据库设计】

Power Design【数据库设计】 前言版权推荐Power Design【数据库设计】推荐11. PowerDesigner的使用11.1 开始界面11.2 概念数据模型11.3 物理数据模型11.4 概念模型转为物理模型11.5 物理模型转为概念模型11.6 物理模型导出SQL语句补充:sqlyog导入sql文件 最后 前言 2024-3-11…

云效流水线部署流程

文章目录 引言I 云效流水线部署流程1.1 前期准备1.2 流程配置引言 前提: 公司允许代码存放在云效允许主机接入阿里云I 云效流水线部署流程 1.1 前期准备 Maven 仓库:用于存放依赖项目的构建镜像仓库:用于存放镜像主机组配置和接入新主机1.2 流程配置 配置代码源和工作目录…

官方安装配置要求服务器最低2核4G

官方安装配置要求服务器至少2核、4G。 如果服务器低于这个要求,就没有必要安装,因为用户体验超级差。 对于服务器CPU来说,建议2到4核就完全足够了,太多就浪费了,但是内存越大越好,最好是4G以上。 如果服务器…

快速排序hoare优化

目录 三数取中法选key 优化点 基本思想 代码实现 小区间优化 优化点 基本思想 代码实现 由于hoare版快排在一些特殊情况下性能并不优,这里我们进行一些优化。 三数取中法选key 优化点 当数据有序时,快排就会很吃力,这是为什么呢…

51、WEB攻防——通用漏洞验证码识别复用调用找回密码重定向状态值

文章目录 回显状态判断用户名重定向验证码回显显示验证码简单机制验证码复用验证码智能识别验证码接口调用安全修复建议 回显状态判断 request前端判断不安全(前端接收验证的返回值来进行判断),使用burp的Response to this request可以抓取返回包~ 这种…

chrome浏览器Network重放重新发送网络请求方法

1. 打开Chrome浏览器,并进入需要重放HTTP请求的网页。 2. 在Chrome浏览器中,按下“F12”键,或者点击菜单栏中的“更多工具” -> “开发者工具”,打开开发者工具面板。 3. 在开发者工具面板中,选择“Network”选项…

Elasticsearch:机器学习与人工智能 - 理解差异

作者:来自 Elastic Aditya Tripathi, Jessica Taylor 长期以来,人工智能几乎完全是科幻小说作家的玩物,人类将技术推得太远,以至于它变得活跃起来 —— 正如好莱坞让我们相信的那样 —— 开始造成严重破坏。 令人愉快的东西&#…