mysql frm权限,将“ x.frm”重命名为“ y.frm”时出错-错误代码:13-权限被拒绝-MySQL...

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.

The problem

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.

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);

Checking perror 13 I was getting 'Win32 - the data is invalid'. No much informative at all.

What I had tried

Change the tmpdir of MySQL (in mysql.ini) to c:\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.

解决方案

Solution

Finally, what solved the problem to me was: change the index name!

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!!

My conclusion

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!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值