mysql数据库表删了重建error_数据库内核月报 - 2015 / 09-MySQL · 捉虫动态 · 建表过程中crash造成重建表失败-阿里云开发者社区...

问题描述

主库的create table语句传到备库,备库SQL线程执行过程中报错:

Error 'Can't create table 'XXX.XX' (errno: -1)' on query. Default database: 'XXX'. Query: 'CREATE TABLE XX ( column_a char(32) NOT NULL, column_b int(10) DEFAULT NULL, column_c int(10) DEFAULT NULL, PRIMARY KEY (column_a), KEY expiry (column_b)) ENGINE=HEAP DEFAULT CHARSET=gbk'

备库 error log:

InnoDB: Error number 17 means 'File exists'.

InnoDB: Some operating system error numbers are described at

InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html

InnoDB: The file already exists though the corresponding table did not

InnoDB: exist in the InnoDB data dictionary. Have you moved InnoDB

InnoDB: .ibd files around without using the SQL commands

InnoDB: DISCARD TABLESPACE and IMPORT TABLESPACE, or did

InnoDB: mysqld cra

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Java进行MySQL操作需要使用JDBC(Java Database Connectivity)技术,具体步骤如下: 1. 加载MySQL驱动程序 在Java连接MySQL数据库需要加载MySQL驱动程序,可以使用Class.forName()方法加载。 ``` Class.forName("com.mysql.jdbc.Driver"); ``` 2. 数据库连接 使用DriverManager.getConnection()方法数据库连接,需要传入数据库URL、用户名和密码。 ``` String url = "jdbc:mysql://localhost:3306/test"; String user = "root"; String password = "123456"; Connection conn = DriverManager.getConnection(url, user, password); ``` 3. 创Statement对象 使用Connection.createStatement()方法创Statement对象,用于执行SQL语句。 ``` Statement stmt = conn.createStatement(); ``` 4. 执行SQL语句 使用Statement.executeUpdate()方法执行SQL语句,可以执行增、、改操作。 ``` String sql = "insert into user(name, age) values('Tom', 20)"; stmt.executeUpdate(sql); ``` 使用Statement.executeQuery()方法执行SQL查询语句,返回ResultSet对象,可以遍历结果集获取查询结果。 ``` String sql = "select * from user"; ResultSet rs = stmt.executeQuery(sql); while(rs.next()) { String name = rs.getString("name"); int age = rs.getInt("age"); System.out.println(name + " " + age); } ``` 5. 关闭连接 使用Connection.close()方法关闭连接。 ``` conn.close(); ``` 以上是Java进行MySQL操作的基本步骤,具体操作需要根据业务需求来设计SQL语句。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值