Mac 系统下使用java Runtime导出 mysql 数据库,以及Process.waitFor()的返回值的含义

发布时间:2018-12-14作者:laosun阅读(2029)

Mac

Mac 系统下使用java java.lang.Runtime.getRuntime().exec 导出 mysql 数据库,以及Process.waitFor()的返回值的含义!

    直接上源码,原理很简单,就是使用java.lang.Runtime.getRuntime().exec

    try {
        String mysql = "/usr/local/mysql/bin/mysqldump --opt -h 192.168.0.XXX --user=root --password=root --result-file=/Users/sun/Documents/m.sql --default-character-set=utf8 数据库名";
        Process p = java.lang.Runtime.getRuntime().exec(mysql);
        if (p.waitFor() == 0) {// 0 表示线程正常终止。
            System.out.println("导出成功");
        }else {
            System.out.println("导出失败,失败码:"+p.waitFor());
        }
    }catch (Exception e) {
        e.printStackTrace();
    }


    Process.waitFor()的返回值的含义


        OS error code 0: Success
        错误代码0:成功

        OS error code 1: Operation not permitted
        错误代码1:操作不允许

        OS error code 2: No such file or directory
        错误代码2:没有这样的文件或目录

        OS error code 3: No such process
        错误代码3:没有这样的过程

        OS error code 4: Interrupted system call
        错误代码4:中断的系统调用

        OS error code 5: Input/output error
        错误代码5:输入/输出错误

        OS error code 6: No such device or address
        错误代码6:没有这样的设备或地址

        OS error code 7: Argument list too long
        错误代码7:参数列表太长

        OS error code 8: Exec format error
        错误代码8:执行格式错误

        OS error code 9: Bad file descriptor
        错误代码9:坏的文件描述符

        OS error code 10: No child processes
        错误代码10:无子过程

        OS error code 11: Resource temporarily unavailable
        错误代码11:资源暂时不可用

        OS error code 12: Cannot allocate memory
        错误代码12:无法分配内存

        OS error code 13: Permission denied
        错误代码13:权限被拒绝

        OS error code 14: Bad address
        错误代码14:错误的地址

        OS error code 15: Block device required

        错误代码15:需要块设备

        OS error code 16: Device or resource busy
        错误代码16:设备或资源忙

        OS error code 17: File exists
        错误代码17:文件已经存在

        OS error code 18: Invalid cross-device link
        错误代码18:无效的跨设备链接

        OS error code 19: No such device
        错误代码19:没有这样的设备

        OS error code 20: Not a directory
        错误代码20:不是一个目录

        OS error code 21: Is a directory
        错误代码21:是一个目录

        OS error code 22: Invalid argument
        错误代码22:无效参数

        OS error code 23: Too many open files in system
        错误代码23:打开太多的文件系统

        OS error code 24: Too many open files
        错误代码24:打开的文件太多

        OS error code 25: Inappropriate ioctl for device
        错误代码25:不适当的设备ioctl使用

        OS error code 26: Text file busy
        错误代码26:文本文件忙

        OS error code 27: File too large
        错误代码27:文件太大

        OS error code 28: No space left on device
        错误代码28:设备上没有空间

        OS error code 29: Illegal seek
        错误代码29:非法搜索

        OS error code 30: Read-only file system
        错误代码30:只读文件系统

        OS error code 31: Too many links
        错误代码31:链接过多

        OS error code 32: Broken pipe
        错误代码32:管道破裂

        OS error code 33: Numerical argument out of domain
        错误代码33:超出域的数值参数

        OS error code 34: Numerical result out of range
        错误代码34:数值结果超出范围

        OS error code 35: Resource deadlock avoided
        错误代码35:避免资源死锁

        OS error code 36: File name too long
        错误代码36:文件名太长

        OS error code 37: No locks available
        错误代码37:没有可用锁

        OS error code 38: Function not implemented
        错误代码38:功能没有实现

        OS error code 39: Directory not empty
        错误代码39:目录非空

        OS error code 40: Too many levels of symbolic links
        错误代码40:符号链接层次太多

        OS error code 42: No message of desired type
        错误代码42:没有期望类型的消息

        OS error code 43: Identifier removed
        错误代码43:标识符删除

        OS error code 44: Channel number out of range
        错误代码44:通道数目超出范围

        OS error code 45: Level 2 not synchronized
        错误代码45:2级不同步

        OS error code 46: Level 3 halted
        错误代码46:3级终止

        OS error code 47: Level 3 reset
        错误代码47:3级复位

        OS error code 48: Link number out of range
        错误代码48:链接数超出范围

        OS error code 49: Protocol driver not attached
        错误代码49:协议驱动程序没有连接

        OS error code 50: No CSI structure available
        错误代码50:没有可用的CSI结构

        OS error code 51: Level 2 halted
        错误代码51:2级中断

        OS error code 52: Invalid exchange
        错误代码52:无效的交换

        OS error code 53: Invalid request descriptor
        错误代码53:无效的请求描述符

        OS error code 54: Exchange full
        错误代码54:交换空间满

        OS error code 55: No anode
        错误代码55:阳极不存在

        OS error code 56: Invalid request code
        错误代码56:无效的请求代码

        OS error code 57: Invalid slot
        错误代码57:无效的槽

        OS error code 59: Bad font file format
        错误代码59:错误的字体文件格式

        OS error code 60: Device not a stream
        错误代码60:设备不属于流类型

        OS error code 61: No data available
        错误代码61:无可用数据

        OS error code 62: Timer expired
        错误代码62:超时

        OS error code 63: Out of streams resources
        错误代码63:超出流资源范围

        OS error code 64: Machine is not on the network
        错误代码64:主机不在网络上

        OS error code 65: Package not installed
        错误代码65:软件包没有安装

        OS error code 66: Object is remote
        错误代码66:对象是远程的

        OS error code 67: Link has been severed
        错误代码67:链接被切断

        OS error code 68: Advertise error
        错误代码68:广告错误

        OS error code 69: Srmount error
        错误代码69:srmount错误

        OS error code 70: Communication error on send
        错误代码70:发送数据时通讯错误

        OS error code 71: Protocol error
        错误代码71:协议错误

        OS error code 72: Multihop attempted
        错误代码72:企图进行多次跳转

        OS error code 73: RFS specific error
        错误代码73:RFS类型错误

        OS error code 74: Bad message
        错误代码74:坏消息

        OS error code 75: Value too large for defined data type
        错误代码75:数值超过对于给定的数据类型

        OS error code 76: Name not unique on network
        错误代码76:主机名在网络上不是唯一

        OS error code 77: File descriptor in bad state
        错误代码77:坏状态的文件描述符

        OS error code 78: Remote address changed
        错误代码78:远端地址改变

        OS error code 79: Can not access a needed shared library
        错误代码79:无法访问需要的共享库

        OS error code 80: Accessing a corrupted shared library
        错误代码80:访问了一个损坏的共享库

        OS error code 81: .lib section in a.out corrupted
        错误代码81: a. out文件中的.lib段损坏。

        OS error code 82: Attempting to link in too many shared libraries
        错误代码82:试图链接太多的共享库

        OS error code 83: Cannot exec a shared library directly
        错误代码83:不能直接执行一个共享库

        OS error code 84: Invalid or incomplete multibyte or wide character
        错误代码84:无效或不完整的多字节以及宽字符

        OS error code 85: Interrupted system call should be restarted
        错误代码85:中断的系统调用需要重新启动

        OS error code 86: Streams pipe error
        错误代码86:流管道错误

        OS error code 87: Too many users
        错误代码87:太多用户

        OS error code 88: Socket operation on non-socket
        错误代码88:在非套接字接口进行套接字操作

        OS error code 89: Destination address required
        错误代码89:需要目标地址

        OS error code 90: Message too long
        错误代码90:消息太长

        OS error code 91: Protocol wrong type for socket
        错误代码91:socket协议错误类型

        OS error code 92: Protocol not available
        错误代码92:协议不可用

        OS error code 93: Protocol not supported
        错误代码93:协议不支持

        OS error code 94: Socket type not supported
        错误代码94:socket类型不支持

        OS error code 95: Operation not supported
        错误代码95:操作不支持

        OS error code 96: Protocol family not supported
        错误代码96:协议族不支持

        OS error code 97: Address family not supported by protocol
        错误代码97:协议不支持地址族

        OS error code 98: Address already in use
        错误代码98:地址已在使用

        OS error code 99: Cannot assign requested address
        错误代码99:无法分配请求的地址

        OS error code 100: Network is down
        错误代码100:网络瘫痪

        OS error code 101: Network is unreachable
        错误代码101:网络不可达

        OS error code 102: Network dropped connection on reset
        错误代码102:网络复位时连接丢失

        OS error code 103: Software caused connection abort
        错误代码103:软件导致连接中断

        OS error code 104: Connection reset by peer
        错误代码104:连接被重置

        OS error code 105: No buffer space available
        错误代码105:没有可用的缓冲空间

        OS error code 106: Transport endpoint is already connected
        错误代码106:传输端点已连接

        OS error code 107: Transport endpoint is not connected
        错误代码107:运输端点没有连接上

        OS error code 108: Cannot send after transport endpoint shutdown
        错误代码108:运输终点关闭后无法发送数据

        OS error code 109: Too many references: cannot splice
        错误代码109:引用太多:不能接合

        OS error code 110: Connection timed out
        错误代码110:连接超时

        OS error code 111: Connection refused
        错误代码111:连接被拒绝

        OS error code 112: Host is down
        错误代码112:主机已关闭

        OS error code 113: No route to host
        错误代码113:没有路由到主机

        OS error code 114: Operation already in progress
        错误代码114:进程已运行

        OS error code 115: Operation now in progress
        错误代码115:正在进行操作

        OS error code 116: Stale NFS file handle
        错误代码116:陈旧的NFS文件句柄

        OS error code 117: Structure needs cleaning
        错误代码117:结构需要清除

        OS error code 118: Not a XENIX named type file
        错误代码118:不是一个XENIX命名类型的文件

        OS error code 119: No XENIX semaphores available
        错误代码119:没有XENIX信号量可用

        OS error code 120: Is a named type file
        错误代码120:是一个指定类型的文件

        OS error code 121: Remote I/O error
        错误代码121:远程输入/输出错误

        OS error code 122: Disk quota exceeded
        错误代码122:超出磁盘配额

        OS error code 123: No medium found
        错误代码123:没有发现介质

        OS error code 124: Wrong medium type
        错误代码124:错误的介质类型

        OS error code 125: Operation canceled
        错误代码125:操作取消

        OS error code 126: Required key not available
        错误代码126:所需的Key不可用

        OS error code 127: Key has expired
        错误代码127:Key已过期

        OS error code 128: Key has been revoked
        错误代码128:Key被撤销

        OS error code 129: Key was rejected by service
        错误代码129:Key被拒绝服务

        OS error code 130: Owner died
        错误代码130:属主死亡

        OS error code 131: State not recoverable
        错误代码131:状态不可恢复

        MySQL error code 132: Old database file
        错误代码132:旧的数据库文件

        MySQL error code 133: No record read before update
        错误代码133 :更新之前没有记录被读

        MySQL error code 134: Record was already deleted (or record file crashed)
        错误代码134 :记录已删除(或记录文件损坏)

        MySQL error code 135: No more room in record file
        错误代码135:记录文件没有更多空间

        MySQL error code 136: No more room in index file
        错误代码136:索引文件没有更多空间

        MySQL error code 137: No more records (read after end of file)
        错误代码137:没有更多的记录(已读至文件尾)

        MySQL error code 138: Unsupported extension used for table
        错误代码138 :不支持表的扩展应用

        MySQL error code 139: Too big row
        错误代码139 :行太大

        MySQL error code 140: Wrong create options
        错误代码140 :错误的创建选项

        MySQL error code 141: Duplicate unique key or constraint on write or update
        错误代码141:写和更新时,独一的键或约束发生重复

        MySQL error code 142: Unknown character set used
        错误代码142 :使用了未知字符集

        MySQL error code 143: Conflicting table definitions in sub-tables of MERGE table
        错误代码143:在合并表的子表中定义冲突

        MySQL error code 144: Table is crashed and last repair failed
        错误代码144 :表损坏,最后一次修复失败

        MySQL error code 145: Table was marked as crashed and should be repaired
        错误代码145 :表被标记为损坏,应该进行修复

        MySQL error code 146: Lock timed out; Retry transaction
        错误代码146 :锁超时,重试事务;

        MySQL error code 147: Lock table is full; Restart program with a larger locktable
        错误代码147 :锁表已满;重启程序,配置更大的locktable表

        MySQL error code 148: Updates are not allowed under a read only transactions
        错误代码148 :在一个只读事务中,不允许进行更新操作

        MySQL error code 149: Lock deadlock; Retry transaction
        错误代码149 :锁死锁;重试事务操作

        MySQL error code 150: Foreign key constraint is incorrectly formed
        错误代码150 :外键约束生成不当

        MySQL error code 151: Cannot add a child row
        错误代码151:无法添加子行

        MySQL error code 152: Cannot delete a parent row
        错误代码152:不能删除父行

1 +1

版权声明

 Java  数据库  mysql  源码

 请文明留言

0 条评论