Mysql常见异常

1 字段过长
com.taobao.tddl.dbsync.applier.ApplierBrokenException: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'feature' at row 1
2 查询超过QueryTimeout
com.taobao.tddl.dbsync.applier.ApplierException: java.sql.SQLException: Query execution was interrupted


JDBC setQueryTimeout函数: 为了避免查询出现死循环,或时间过长等现象,而导致线程阻塞,在获得Statement的实例后,stmt.setQueryTimeout(10); 避免因为查询导致程序出现线程阻塞。 jdbc客户端怎么实现QueryTimeout的?能不能再服务端做?怎么做?


2  mysql死锁
com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction


3 使用了已经关闭的连接池
javax.resource.ResourceException: You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.


4 binlog 文件被删掉,但是的索引未被删掉了
mysql> show binlog events limit 1;
ERROR 29 (HY000): File '/u01/mysql/log/mysql-bin.002293' not found (Errcode: 2)




5 没有dump binlog权限 执行show master status; 抛出的异常
    stmt = conn.createStatement();
    rs = stmt.executeQuery("SHOW MASTER STATUS");

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation












































评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值