In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
-- an error is reported when adding self-increasing fields to the table
Mysql > desc T7
+-+ +
| | Field | Type | Null | Key | Default | Extra | |
+-+ +
| | name | varchar (20) | YES | | NULL |
| | id | int (4) | YES | | NULL |
+-+ +
2 rows in set (0.00 sec)
Mysql > alter table T7 add id2 int (4) auto_increment
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key
Cause of error: the self-increment field is not defined as a key.
Solution: you can define the new field as unique key or primary key.
Mysql > alter table T7 add id2 int (4) auto_increment primary key
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
Mysql > alter table T7 drop column id2
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
Mysql > alter table T7 add id2 int (4) auto_increment unique key
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.