Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I get the following error on my MySQL database

Cant unlock file (Errcode: 11)

But this error only happens when I try to access my new table I created below has two tables 1st I created recently and the second was already created when I got the database to update it How I'm remove the errors?

CREATE TABLE `tbl_produtos` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Nome` varchar(140) DEFAULT NULL,
  `Descricao` text,
  `FotoDestaque` varchar(190) DEFAULT NULL,
  `FK_Categoria` int(11) DEFAULT NULL,
  `FK_SubCategoria` int(11) DEFAULT NULL,
  `Count` int(11) DEFAULT '0',
  `Valor` float DEFAULT NULL,
  `Propriedades` varchar(5) NOT NULL DEFAULT '0,1',
  `FotoCapa` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=latin1;


CREATE TABLE `tbl_admin_logs` (
  `RegistroID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `UsuarioID` int(10) unsigned NOT NULL,
  `UsuarioNome` varchar(45) COLLATE latin1_general_ci NOT NULL,
  `Modulo` varchar(25) COLLATE latin1_general_ci NOT NULL,
  `Registro` text COLLATE latin1_general_ci NOT NULL,
  `IProtocol` varchar(20) COLLATE latin1_general_ci NOT NULL,
  `Data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`RegistroID`)
) ENGINE=InnoDB AUTO_INCREMENT=383 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

EDIT:

SELECT @@VERSION = 5.1.39-community
SHOW GLOBAL VARIABLES LIKE '%locking%'= 
Variable_name: skip_external_locking Value: OFF
share|improve this question
    
Please include the output from SELECT @@VERSION; and SHOW GLOBAL VARIABLES LIKE '%locking%'; and mention your server's operating system. –  Michael - sqlbot Dec 18 '13 at 17:52
    
Please post your my.cnf (or my.ini if using Windows) in the question. –  RolandoMySQLDBA Dec 18 '13 at 19:28
    
I just remove group by from query this: SELECT * FROM tbl_classificados p INNER JOIN tbl_class_cats c WHERE ((p.Nome LIKE '%b%') OR (p.Descricao LIKE '%b%') OR (c.Nome LIKE '%b%')) GROUP BY (p.ID); And don't have error anymore... but why this happened? –  Bruno Casali Dec 19 '13 at 11:08
add comment

1 Answer 1

up vote 2 down vote accepted

My suspicion would be that you are either using external_locking or you have character set issues.

It might center around the following bugs

I would suggest upgrading to MySQL 5.6 as this situation is consistent with MySQL 5.1.

share|improve this answer
    
So, usually this error happen with MySQL 5.1? Thanks very much! –  Bruno Casali Dec 19 '13 at 11:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.