MySQL下perror工具查看System Error Code信息
?
?在MySQL數(shù)據(jù)庫的維護過程中,我們有時候會在MySQL的錯誤日志文件中看到一些關于Operating system error的錯誤信息,例如在MySQL的錯誤日志里面,有時候會看到關于
?
InnoDB: Operating system error number 0.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
?
?
InnoDB: Operating system error number 5.
...........................................
?
?那么這些System Error Code在Linux下分別代表什么意思呢?其實如果遇到錯誤日志里有這些對應的代碼,使用MySQL自帶的命令工具perror查看一下具體信息即可。非常簡單方便。
?
[root@DB-Server ~]# perror 2;
OS error code?? 2:? No such file or directory
[root@DB-Server ~]# perror 3;
OS error code?? 3:? No such process
[root@DB-Server ~]# perror 4;
OS error code?? 4:? Interrupted system call
[root@DB-Server ~]# perror 5;
OS error code?? 5:? Input/output error
[root@DB-Server ~]#
?
如果你要查看一個范圍的Operating system error,可以使用下面命令
?
[root@DB-Server ~]# perror `seq 0 10`
OS error code?? 0:? Success
OS error code?? 1:? Operation not permitted
OS error code?? 2:? No such file or directory
OS error code?? 3:? No such process
OS error code?? 4:? Interrupted system call
OS error code?? 5:? Input/output error
OS error code?? 6:? No such device or address
OS error code?? 7:? Argument list too long
OS error code?? 8:? Exec format error
OS error code?? 9:? Bad file descriptor
OS error code? 10:? No child processes
[root@DB-Server ~]#
?
? 如果是集群,那么可以shell> perror --ndb errorcode查看, 下面表格是關于Linux平臺下通用的System Error Code列表,如下所示,完全沒有必要硬性記住。遇到查看即可。
?
?
| Number | Macro | Description |
| 1 | EPERM | Operation not permitted |
| 2 | ENOENT | No such file or directory |
| 3 | ESRCH | No such process |
| 4 | EINTR | Interrupted system call |
| 5 | EIO | I/O error |
| 6 | ENXIO | No such device or address |
| 7 | E2BIG | Arg list too long |
| 8 | ENOEXEC | Exec format error |
| 9 | EBADF | Bad file number |
| 10 | ECHILD | No child processes |
| 11 | EAGAIN | Try again |
| 12 | ENOMEM | Out of memory |
| 13 | EACCES | Permission denied |
| 14 | EFAULT | Bad address |
| 15 | ENOTBLK | Block device required |
| 16 | EBUSY | Device or resource busy |
| 17 | EEXIST | File exists |
| 18 | EXDEV | Cross-device link |
| 19 | ENODEV | No such device |
| 20 | ENOTDIR | Not a directory |
| 21 | EISDIR | Is a directory |
| 22 | EINVAL | Invalid argument |
| 23 | ENFILE | File table overflow |
| 24 | EMFILE | Too many open files |
| 25 | ENOTTY | Inappropriate ioctl for device |
| 26 | ETXTBSY | Text file busy |
| 27 | EFBIG | File too large |
| 28 | ENOSPC | No space left on device |
| 29 | ESPIPE | Illegal seek |
| 30 | EROFS | Read-only file system |
| 31 | EMLINK | Too many links |
?
?
如果是Windows平臺,那么也可以使用下面命令查看具體的System Error Code信息,另外,Windows平臺下的System Error Code也遠比Linux平臺下要多,遇到了這些System Error Code,使用命令查看即可。
?
perror.exe 2
?
?
perror `perl -e "print join ' ',1..100"`
?
?
?
?
參考資料:
?
http://doc.docs.sk/mysql-refman-5.5/operating-system-error-codes.html
轉載于:https://www.cnblogs.com/kerrycode/p/8698890.html
總結
以上是生活随笔為你收集整理的MySQL下perror工具查看System Error Code信息的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2018.1.21 数论笔记
- 下一篇: linux cmake编译源码,linu