When trying to alter a table in MySQL, I get "Error on rename... (Errcode: 13)"
I am trying to add a simple column, like so many times before:
ALTER TABLE main_user ADD `member_rank` int(11) NULL DEFAULT NULL
But the operation fails with MySQL saying:
Error on rename of '.\hoytocoyo\main_user.MYI' to '.\hoytocoyo\#sql2-ad4-9c.MYI' (Errcode: 13)
I am running Windows Vista, Apache 2.2.3, MySQL 5.0.27
It seems to me that trying to rename a file to something including a "#" symbol is bound to fail, since this character is not allowed...
What can I do?
Status:
Open Nov 14, 2008 - 06:51 AM
mysql, database, web development
4answers
Answers
Nov 14, 2008 - 09:26 AM
error code 13 can also mean permission denied right? I assume that write permissions have been set? and of course mysql is running.
# is a valid character in windows xp, I assume it would be the same in vista.
Im a little confused though by your comment. You gave sql to add a column but you are talking about the rename of a file
Nov 14, 2008 - 08:47 PM
"ALTER TABLE table_name ADD `member_rank` int( 11 ) NULL DEFAULT NULL" Your code is right and error code 13 is regarding permission that means you don't have the right to alter the table.
You can grant user permissiom like this:
USE table_name
GO
GRANT VIEW ANY DEFINITION TO user_name
Jan 05, 2009 - 09:41 PM
Yes, my SQL query is correct and yet my MySQL server returned an error message when trying to execute the query.
Eventually it was simply solved by restarting MySQL, but it kept popping up from time to time. Sometimes my tables also locked and newly inserted data disappeared without warning.
In the end I think it had to do with the MySQL service being run with insufficient user permissons in Vista, or the files being protected from modification by the user runnung the MySQL service.
So I changed the security options for the "mysql" folder and subfolders by right clicking on it, choosing "Properties" and going to the "Security" tab. There I made sure that the default user had "Full control" ticked and applied the changes.
Since then I've had none such problems.
PS: It might be interesting for others to know that my invironment (apache, php, mysql) was originally installed via "EasyPHP 2.0b1" so it seems that this application was the one messing things up to start with, perhaps because it wasn't yet fully compatible with Windows Vista.
Jan 07, 2009 - 05:42 AM
thanks, this has helped me as well
Answer this question
Share Your Own Experience & Expertise
We look to ensure that every question is answered by the best people with relevant expertise and experience, the best answers include multiple perspectives. Do you have relevant expertise or experience to contribute your answer to any of these commonly asked questions?
Add New Comment