Error: ERROR 1050 (42S01) : Table '%.*s' already exists
Error code
Error code in OceanBase Database: 5020
MySQL error code: 1050
Example
When you create a student table, this error is returned, indicating that the table already exists.
obclient> CREATE TABLE student(
id int ,
name varchar(18),
sex char(1),
age int,
address varchar(200),
email varchar(100),
date date,
PRIMARY KEY (id)
);
ERROR 1050 (42S01): Table 'student' already exists
Troubleshooting procedure
Check whether this table already exists in the database. Sample code:
obclient> show tables; +----------------+ | Tables_in_test | +----------------+ | student | +----------------+ 1 row in setIf the table already exists, rename the table by changing
studenttot_stu.obclient> ALTER TABLE student RENAME TO t_stu; Query OK, 0 rows affectedNote
If the table is no longer needed, execute the
DROP TABLEstatement to drop the table so that you can then create a new one.