mysql表无法添加字段是什么问题啊
PHP中文网
PHP中文网 2017-04-17 11:47:54
0
2
970

添加过一次sql失败了之后,再执行该sql,就报错了,无法添加字段

sql:
ALTER TABLE bms_c.room ADD COLUMN live_id INT(11) DEFAULT '0'

错误信息:
Query : alter table bms_c.room add column live_id int(11) DEFAULT '0'
Error Code : 1050
Table 'bms_c/#sql-ib1551' already exists
Execution Time : 00:00:00:000
Transfer Time : 00:00:00:000
Total Time : 00:00:00:000

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
PHPzhong

alter table table name add field name int default 0
//Since it is an int type, why does it default to 0 for the string when you add it?

小葫芦

alter table will create a new empty table, fill it with data, and then delete the original table.
Judging from your prompt, it may be that the sql execution failed last time, but the temporary table created was retained

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template