问题描述
好吧,我知道关于这个问题有很多问题,但是由于找不到解决我的问题的答案(我尝试了很多很多变通方法!!),这使我浪费了4个小时的工作,现在我发现了问题所在,我也想分享和保存在这里,以备将来参考。
Ok, I know there is so many questions about this issue but, since I could not find a answer to solve my problem (I tried so many many many workarounds!!) and it made me to waste 4 hours of my work, and now I found where my problem were in, I would like to share and keep here also for my own future reference.
将 .\db_testes\#sql-1f1c_1a.frm重命名为 .\db_testes\alteracaocrono_ateste.frm时出错'(错误代码:13-权限被拒绝)
在创建后立即在MySQL表中创建索引时发生的情况。
Error on rename of '.\db_testes\#sql-1f1c_1a.frm' to '.\db_testes\alteracaocrono_ateste.frm' (Errcode: 13 - Permission denied)
that was happening when creating an index in a MySQL table just after to create it.
为什么是
SO 很奇怪吗?
1.因为它是在脚本中发生的,所以我有那么多其他的创建表和创建索引在错误发生之前都可以正常工作;
2.因为每次我在清理数据库后再次尝试运行它时,该错误都发生在不同的地方,每次都使用不同的索引!;
3.因为与MySQL相关的所有文件夹都对所有人具有完全控制权限(我很拼命,我知道);
Why is this SO strange?
1. Because it was happening in a script were I had so many others 'create table's and 'create index' that were working fine just before the error happen;
2. Because everytime I tried it after cleaning the database to run it again, that error occurred in a different place, a different index each time!;
3. Because all folders related to MySQL had FULL-CONTROLL permissions for 'everybody' (I was desperate, I know);
检查错误13
我得到的是 Win32-数据无效。根本没有提供太多信息。
Checking perror 13
I was getting 'Win32 - the data is invalid'. No much informative at all.
- 更改
tmpdir MySQL的
c:\temp (不幸的是,我必须在工作中使用Windows进行编程!); - 更改所有数据文件夹和所有mysql文件夹;
- 重新启动的次数太多(为了Windows的存在);
- 在另一个文件夹中删除并重新安装MySQL;
- 将tmpdir和mysql数据文件夹中的
完全控制权
的权限更改;
- Change the
tmpdir
of MySQL (in mysql.ini) toc:\temp
(unfortunately, I have to use windows to programming in my work!); - Change all the data folder and all mysql folder;
- So many restarts (for the sake the Windows way to exist);
- Remove and reinstall MySQL in a different folder;
- Change permissions to
full-controll
in tmpdir and mysql data folders;
请查看我的答案以了解如何解决。
Please, see my answer to know how I solved it.
推荐答案
解决方案
最后,对我来说解决问题的是:更改索引名称!
但是,等等,这个名字没有重复!我是第一次寻找它的!而且时间还不太长!它与同一脚本中的其他脚本相似。 *没有特殊字符!**类似于 IX_TAB_ABC_123
。因此,世界上将如何猜出问题出在哪里?。由于某种原因,MySQL只是不喜欢我选择的名字,但它并没有让我知道为什么!
But wait, the name was not repeated! I had looked for it right in the first time! And it also was not too long! It was similar to others in the same script. It *had not special chars!** It was something like IX_TAB_ABC_123
. So, how in the world would somebody to guess what the problem was??. For some reason, MySQL just didn't like the name I pick but it did not let me know why!!
制作软件时,请不要傻!贴上重要的错误信息! 重要是指清除和客观错误消息,它们指出确切的问题,原因以及可能的解决方案。
When you make a software, please, dont be stupid! Put significative error messages on it! By "significative" I mean clear and objective error messages pointing the exact problem, the reason and, when possible, the solution. The world will be a better place if you just do it, believe me!
希望它可以帮助其他有这个愚蠢问题的人!
Hope it helps anybody else having this stupid problem!
这篇关于将“ x.frm”重命名为“ y.frm”时出错-错误代码:13-权限被拒绝-MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!