mysql 启动错误(InnoDB: Operating system error number 13 )
环境:mysq 5.6.35、centos 7.3
问题描述:
今天下午开发过来说开发库无法连接了,登录服务器后发现mysql进程down了
启动mysql:
/bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf &
启动时报错,无法正常启动mysql
查询告警日志文件
如果错误信息如下
2018-07-03 15:19:11 7f6e0dc9e700 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights toInnoDB: the directory.2018-07-03 15:19:11 7f6e0dc9e700 InnoDB: Assertion failure in thread 140110654465792 in file fil0fil.cc line 875InnoDB: Failing assertion: retInnoDB: We intentionally generate a memory trap.InnoDB: Submit a detailed bug report to http://bugs.mysql.com.InnoDB: If you get repeated assertion failures or crashes, evenInnoDB: immediately after the mysqld startup, there may beInnoDB: corruption in the InnoDB tablespace. Please refer toInnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.htmlInnoDB: about forcing recovery.07:19:11 UTC - mysqld got signal 6 ;This could be because you hit a bug. It is also possible that this binaryor one of the libraries it was linked against is corrupt, improperly built,or misconfigured. This error can also be caused by malfunctioning hardware.We will try our best to scrape up some info that will hopefully helpdiagnose the problem, but since we have already crashed, something is definitely wrong and this may fail.key_buffer_size=8388608read_buffer_size=262144max_used_connections=5max_threads=1024thread_count=3connection_count=3It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 545584 K bytes of memoryHope that's ok; if not, decrease some variables in the equation.Thread pointer: 0x511a8b0Attempting backtrace. You can use the following information to find outwhere mysqld died. If you see no messages after this, something wentterribly wrong...stack_bottom = 7f6e0dc9de90 thread_stack 0x30000/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0x9122f5]/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x3d8)[0x675f18]/lib64/libpthread.so.0(+0xf370)[0x7f6e7ca9a370]/lib64/libc.so.6(gsignal+0x37)[0x7f6e7b6991d7]/lib64/libc.so.6(abort+0x148)[0x7f6e7b69a8c8]/usr/local/mysql/bin/mysqld[0xa74431]/usr/local/mysql/bin/mysqld[0xa7462b]/usr/local/mysql/bin/mysqld[0xa7d319]/usr/local/mysql/bin/mysqld[0xa480f0]/usr/local/mysql/bin/mysqld[0xa489cb]/usr/local/mysql/bin/mysqld[0xa36643]/usr/local/mysql/bin/mysqld[0xa2177f]/usr/local/mysql/bin/mysqld[0x9cb948]/usr/local/mysql/bin/mysqld[0x92cf30]/usr/local/mysql/bin/mysqld[0x924799]/usr/local/mysql/bin/mysqld[0x92cc69]/usr/local/mysql/bin/mysqld(_ZN7handler11ha_rnd_nextEPh+0x64)[0x58cf54]/usr/local/mysql/bin/mysqld(_Z13rr_sequentialP11READ_RECORD+0x37)[0x841ba7]/usr/local/mysql/bin/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0x10f)[0x6d472f]/usr/local/mysql/bin/mysqld(_ZN4JOIN4execEv+0x435)[0x6d21e5]/usr/local/mysql/bin/mysqld[0x719839]/usr/local/mysql/bin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_P10SQL_I_ListI8st_orderESB_S7_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xbc)[0x719b6c]/usr/local/mysql/bin/mysqld(_Z13handle_selectP3THDP13select_resultm+0x184)[0x719d84]/usr/local/mysql/bin/mysqld[0x6f3da9]/usr/local/mysql/bin/mysqld(_Z21mysql_execute_commandP3THD+0x3ab7)[0x6f9457]/usr/local/mysql/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x377)[0x6fcb77]/usr/local/mysql/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x19ed)[0x6fec8d]/usr/local/mysql/bin/mysqld(_Z10do_commandP3THD+0xd7)[0x7000e7]/usr/local/mysql/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x116)[0x6c6ca6]/usr/local/mysql/bin/mysqld(handle_one_connection+0x45)[0x6c6d85]/usr/local/mysql/bin/mysqld(pfs_spawn_thread+0x126)[0xae5796]/lib64/libpthread.so.0(+0x7dc5)[0x7f6e7ca92dc5]/lib64/libc.so.6(clone+0x6d)[0x7f6e7b75b76d]Trying to get some variables.Some pointers may be invalid and cause the dump to abort.Query (7f6db4013740): is an invalid pointerConnection ID (thread ID): 194Status: NOT_KILLEDThe manual page at http://dev.mysql.com/doc/mysql/en/crashing.html containsinformation that should help you find out what is causing the crash.通过上述报错日志内容分析可能是权限导致的
错误13说明没有权限。使用命令
chmod -R 777 可以解决
[root@dev mysql]# chmod -R 777 /usr/local/mysql/
[root@dev mysql]# chown -R mysql:mysql /usr/local/mysql/[root@dev mysql]# chmod -R 777 /mysql/data/
[root@dev mysql]# chown -R mysql:mysql /mysql/data/提示一下:这个error number 就是系统的错误号,也是程序里的errorno
附上linux的 错误码信息
errno.00 is: Success 成功errno.01 is: Operation not permitted 不允许此类操作errno.02 is: No such file or directory 没有此文件或目录errno.03 is: No such process 没有此进程errno.04 is: Interrupted system call 中断系统调用errno.05 is: Input/output error 输入输出错误errno.06 is: No such device or address 没有此设备或地址errno.07 is: Argument list too long 参数过长errno.08 is: Exec format error 执行格式错误errno.09 is: Bad file descriptor 无效的文件描述符errno.10 is: No child processes 不存在子进程errno.11 is: Resource temporarily unavailable 资源暂时不可用errno.12 is: Cannot allocate memory 分配内存失败errno.13 is: Permission denied 权限错误errno.14 is: Bad address 地址错误errno.15 is: Block device required 块设备请求errno.16 is: Device or resource busy 设备或资源忙errno.17 is: File exists 文件已经存在errno.18 is: Invalid cross-device link 无效的交叉连接设备errno.19 is: No such device 没有此设备errno.20 is: Not a directory 不是一个目录errno.21 is: Is a directory 是一个目录errno.22 is: Invalid argument 参数非法errno.23 is: Too many open files in system 系统打开文件太多errno.24 is: Too many open files 打开文件太多errno.25 is: Inappropriate ioctl for device 设备部支持该操作errno.26 is: Text file busy 文本文件忙errno.27 is: File too large 文件太大errno.28 is: No space left on device 设备没有空间,一般为存储设备errno.29 is: Illegal seek 非法的seek操作errno.30 is: Read-only file system 只读文件系统errno.31 is: Too many links 太多连接errno.32 is: Broken pipe 管道破裂errno.33 is: Numerical argument out of domain 数值参数超出取值范围errno.34 is: Numerical result out of range 数值结果超出取值范围errno.35 is: Resource deadlock avoided 资源死锁errno.36 is: File name too long 文件名太长errno.37 is: No locks available 没有可用的锁errno.38 is: Function not implemented 函数没有执行errno.39 is: Directory not empty 目录非空errno.40 is: Too many levels of symbolic links 太多级符号连接errno.41 is: Unknown error 41 41未知错误errno.42 is: No message of desired type 不被接受的消息类型errno.43 is: Identifier removed 标识符已被删除errno.44 is: Channel number out of range 。。。errno.45 is: Level 2 not synchronizederrno.46 is: Level 3 haltederrno.47 is: Level 3 reseterrno.48 is: Link number out of rangeerrno.49 is: Protocol driver not attachederrno.50 is: No CSI structure availableerrno.51 is: Level 2 haltederrno.52 is: Invalid exchangeerrno.53 is: Invalid request descriptorerrno.54 is: Exchange fullerrno.55 is: No anodeerrno.56 is: Invalid request codeerrno.57 is: Invalid sloterrno.58 is: Unknown error 58errno.59 is: Bad font file formaterrno.60 is: Device not a streamerrno.61 is: No data availableerrno.62 is: Timer expirederrno.63 is: Out of streams resourceserrno.64 is: Machine is not on the networkerrno.65 is: Package not installederrno.66 is: Object is remoteerrno.67 is: Link has been severederrno.68 is: Advertise errorerrno.69 is: Srmount errorerrno.70 is: Communication error on senderrno.71 is: Protocol errorerrno.72 is: Multihop attemptederrno.73 is: RFS specific errorerrno.74 is: Bad messageerrno.75 is: Value too large for defined data typeerrno.76 is: Name not unique on networkerrno.77 is: File descriptor in bad stateerrno.78 is: Remote address changederrno.79 is: Can not access a needed shared libraryerrno.80 is: Accessing a corrupted shared libraryerrno.81 is: .lib secion in a.out corruptederrno.82 is: Attempting to link in too many shared librarieserrno.83 is: Cannot exec a shared library directlyerrno.84 is: Invalid or incomplete multibyte or wide charactererrno.85 is: Interrupted system call should be restartederrno.86 is: Streams pipe errorerrno.87 is: Too many userserrno.88 is: Socket operation on non-socketerrno.89 is: Destination address requirederrno.90 is: Message too longerrno.91 is: Protocol wrong type for socketerrno.92 is: Protocol not availableerrno.93 is: Protocol not supportederrno.94 is: Socket type not supportederrno.95 is: Operation not supportederrno.96 is: Protocol family not supportederrno.97 is: Address family not supported by protocolerrno.98 is: Address already in useerrno.99 is: Cannot assign requested addresserrno.100 is: Network is downerrno.101 is: Network is unreachableerrno.102 is: Network dropped connection on reseterrno.103 is: Software caused connection aborterrno.104 is: Connection reset by peererrno.105 is: No buffer space availableerrno.106 is: Transport endpoint is already connectederrno.107 is: Transport endpoint is not connectederrno.108 is: Cannot send after transport endpoint shutdownerrno.109 is: Too many references: cannot spliceerrno.110 is: Connection timed outerrno.111 is: Connection refusederrno.112 is: Host is downerrno.113 is: No route to hosterrno.114 is: Operation already in progresserrno.115 is: Operation now in progresserrno.116 is: Stale NFS file handleerrno.117 is: Structure needs cleaningerrno.118 is: Not a XENIX named type fileerrno.119 is: No XENIX semaphores availableerrno.120 is: Is a named type fileerrno.121 is: Remote I/O errorerrno.122 is: Disk quota exceedederrno.123 is: No medium founderrno.124 is: Wrong medium typeerrno.125 is: Operation cancelederrno.126 is: Required key not availableerrno.127 is: Key has expirederrno.128 is: Key has been revokederrno.129 is: Key was rejected by serviceerrno.130 is: Owner diederrno.131 is: State not recoverableerrno.132 is: Unknown error 132132-255全是Unknown errorwindows的错误码信息
Number | Macro | Description |
---|---|---|
1 | ERROR_INVALID_FUNCTION | Incorrect function. |
2 | ERROR_FILE_NOT_FOUND | The system cannot find the file specified. |
3 | ERROR_PATH_NOT_FOUND | The system cannot find the path specified. |
4 | ERROR_TOO_MANY_OPEN_FILES | The system cannot open the file. |
5 | ERROR_ACCESS_DENIED | Access is denied. |
6 | ERROR_INVALID_HANDLE | The handle is invalid. |
7 | ERROR_ARENA_TRASHED | The storage control blocks were destroyed. |
8 | ERROR_NOT_ENOUGH_MEMORY | Not enough storage is available to process this command. |
9 | ERROR_INVALID_BLOCK | The storage control block address is invalid. |
10 | ERROR_BAD_ENVIRONMENT | The environment is incorrect. |
11 | ERROR_BAD_FORMAT | An attempt was made to load a program with an incorrect format. |
12 | ERROR_INVALID_ACCESS | The access code is invalid. |
13 | ERROR_INVALID_DATA | The data is invalid. |
14 | ERROR_OUTOFMEMORY | Not enough storage is available to complete this operation. |
15 | ERROR_INVALID_DRIVE | The system cannot find the drive specified. |
16 | ERROR_CURRENT_DIRECTORY | The directory cannot be removed. |
17 | ERROR_NOT_SAME_DEVICE | The system cannot move the file to a different disk drive. |
18 | ERROR_NO_MORE_FILES | There are no more files. |
19 | ERROR_WRITE_PROTECT | The media is write protected. |
20 | ERROR_BAD_UNIT | The system cannot find the device specified. |
21 | ERROR_NOT_READY | The device is not ready. |
22 | ERROR_BAD_COMMAND | The device does not recognize the command. |
23 | ERROR_CRC | Data error (cyclic redundancy check). |
24 | ERROR_BAD_LENGTH | The program issued a command but the command length is incorrect. |
25 | ERROR_SEEK | The drive cannot locate a specific area or track on the disk. |
26 | ERROR_NOT_DOS_DISK | The specified disk or diskette cannot be accessed. |
27 | ERROR_SECTOR_NOT_FOUND | The drive cannot find the sector requested. |
28 | ERROR_OUT_OF_PAPER | The printer is out of paper. |
29 | ERROR_WRITE_FAULT | The system cannot write to the specified device. |
30 | ERROR_READ_FAULT | The system cannot read from the specified device. |
31 | ERROR_GEN_FAILURE | A device attached to the system is not functioning. |
32 | ERROR_SHARING_VIOLATION | The process cannot access the file because it is being used by another process. |
33 | ERROR_LOCK_VIOLATION | The process cannot access the file because another process has locked a portion of the file. |
34 | ERROR_WRONG_DISK | The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) into drive %1. |
36 | ERROR_SHARING_BUFFER_EXCEEDED | Too many files opened for sharing. |
38 | ERROR_HANDLE_EOF | Reached the end of the file. |
39 | ERROR_HANDLE_DISK_FULL | The disk is full. |
87 | ERROR_INVALID_PARAMETER | The parameter is incorrect. |
112 | ERROR_DISK_FULL | The disk is full. |
123 | ERROR_INVALID_NAME | The file name, directory name, or volume label syntax is incorrect. |
1450 | ERROR_NO_SYSTEM_RESOURCES | Insufficient system resources exist to complete the requested service |