简体   繁体   English

我的SQL错误#1015 - 无法锁定文件(错误:165 - 表格只读)只有innodb引擎

[英]My SQL error #1015 - Can't lock file (errno: 165 - Table is read only) innodb engine only

My SQL error 我的SQL错误

#1015 - Can't lock file (errno: 165 - Table is read only)

innodb engine only 只有innodb引擎

first the MySql start to stop work and needed restart almost every day 首先,MySql开始停止工作,几乎每天都需要重启

then it's start to work in read only mode 然后它开始以只读模式工作

MySQL version is 5.6 MySQL版本是5.6

my.cnf content my.cnf的内容

[mysqld]
innodb_file_per_table=1
default-storage-engine=MyISAM
max_allowed_packet=268435456
innodb_buffer_pool_size=134217728
innodb_force_recovery=4

my log 我的日志

140819 05:48:57 mysqld_safe mysqld from pid file /var/lib/mysql/server1.mohdev.com.pid ended
140819 05:48:58 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2014-08-19 05:48:59 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-08-19 05:48:59 9876 [Note] Plugin 'FEDERATED' is disabled.
2014-08-19 05:48:59 9876 [Note] InnoDB: Started in read only mode
2014-08-19 05:48:59 9876 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-08-19 05:48:59 9876 [Note] InnoDB: The InnoDB memory heap is disabled
2014-08-19 05:48:59 9876 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-08-19 05:48:59 9876 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-08-19 05:48:59 9876 [Note] InnoDB: Using Linux native AIO
2014-08-19 05:48:59 9876 [Note] InnoDB: Using CPU crc32 instructions
2014-08-19 05:48:59 9876 [Note] InnoDB: Disabling background IO write threads.
2014-08-19 05:48:59 9876 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-08-19 05:48:59 9876 [Note] InnoDB: Completed initialization of buffer pool
2014-08-19 05:48:59 9876 [Note] InnoDB: Highest supported file format is Barracuda.
2014-08-19 05:48:59 9876 [Note] InnoDB: 5.6.17 started; log sequence number 2706168115
2014-08-19 05:48:59 9876 [Note] InnoDB: !!! innodb_force_recovery is set to 4 !!!
2014-08-19 05:48:59 9876 [Note] Server hostname (bind-address): '*'; port: 3306
2014-08-19 05:48:59 9876 [Note] IPv6 is not available.
2014-08-19 05:48:59 9876 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
2014-08-19 05:48:59 9876 [Note] Server socket created on IP: '0.0.0.0'.
2014-08-19 05:48:59 9876 [Note] Event Scheduler: Loaded 0 events
2014-08-19 05:48:59 9876 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.17'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
2014-08-19 05:49:22 9876 [ERROR] InnoDB: Failed to find tablespace for table '"epl_mdb"."jpxsqzjy_options"' in the cache. Attempting to load the tablespace with space id 1156.
2014-08-19 05:49:22 9876 [Warning] InnoDB: Allocated tablespace 1156, old maximum was 0
2014-08-19 05:49:22 9876 [ERROR] InnoDB: Failed to find tablespace for table '"epl_mdb"."jpxsqzjy_posts"' in the cache. Attempting to load the tablespace with space id 584.
2014-08-19 05:49:23 9876 [ERROR] InnoDB: Failed to find tablespace for table '"epl_mdb"."jpxsqzjy_term_taxonomy"' in the cache. Attempting to load the tablespace with space id 591.
2014-08-19 05:54:26 9876 [Note] /usr/sbin/mysqld: Normal shutdown

2014-08-19 05:54:26 9876 [Note] Giving 1 client threads a chance to die gracefully
2014-08-19 05:54:26 9876 [Note] Event Scheduler: Purging the queue. 0 events
2014-08-19 05:54:26 9876 [Note] Shutting down slave threads
2014-08-19 05:54:28 9876 [Note] Forcefully disconnecting 1 remaining clients
2014-08-19 05:54:28 9876 [Warning] /usr/sbin/mysqld: Forcing close of thread 3  user: 'leechprotect'

i tried to add 我试图添加

innodb-read-only=0

in my.cnf but no luck any suggestions thanks 在my.cnf但没有运气任何建议谢谢

You have this in your config: 你在配置中有这个:

innodb_force_recovery=4

http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html says: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html说:

As of 5.6.6, an innodb_force_recovery setting of 4 or greater places InnoDB in read-only mode. 从5.6.6开始,innodb_force_recovery设置为4或更高,将InnoDB置于只读模式。

That option is something you'd do only while trying to extract data from a corrupted tablespace. 只有在尝试从损坏的表空间中提取数据时,才会执行该选项。 You should remove that option from you my.cnf and restart. 您应该从my.cnf中删除该选项并重新启动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM