我很难删除表userprofile_userprofile
的索引:
以下是索引:
MariaDB [djdb]> SHOW INDEX FROM userprofile_userprofile;
+-------------------------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------------------------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| userprofile_userprofile | 0 | PRIMARY | 1 | id | A | 14566 | NULL | NULL | | BTREE | | |
| userprofile_userprofile | 1 | id-userid-idx | 1 | id | A | 14566 | NULL | NULL | | BTREE | | |
| userprofile_userprofile | 1 | id-userid-idx | 2 | user_id | A | 14566 | NULL | NULL | | BTREE | | |
+-------------------------+------------+---------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
当我尝试:
MariaDB [djdb]> ALTER TABLE userprofile_userprofile DROP INDEX id-userid-idx;
我收到此错误:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-userid-idx' at line 1
我也试过
DROP INDEX id-userid-idx ON userprofile_userprofile;
但是得到同样的错误。 我想知道这里有什么问题,我怎么能放弃索引?