网站内容如何优化,wordpress4.9.8优化,企业网站的开发建设方案怎么写,十大不收费的软件2023年一个客户向我抱怨#xff1a;在MySQL查询小表没有问题#xff0c;查询大表出错#xff0c;下面是他发给我的出错的部分截屏#xff08;客户的表名被我隐藏了#xff09;。 这里的给出的信息已经比较明显了#xff0c;是向/tmp目录中创建临时表失败#xff08;临时表的路…一个客户向我抱怨在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, were sending the information to the error-log instead: MY-000001 - Cant 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, were sending the information to the error-log instead: MY-000001 - Cant 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, were sending the information to the error-log instead: MY-000001 - Cant 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, were sending the information to the error-log instead: MY-000001 - Cant 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, were sending the information to the error-log instead: MY-000001 - Cant 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, were sending the information to the error-log instead: MY-000001 - Cant 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, were sending the information to the error-log instead: MY-000001 - Cant create/write to file /tmp/iblFGa8t (OS errno 13 - Permission denied)
看来是/tmp目录的权限出了问题检查一下
oracleScott ~$ ll -ld /tmp
drwxrwxrwt. 11 root root 4096 Jan 29 09:22 /tmp
oracleScott ~$[rootoracle 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 然后故障排除