Why I can't remove field from MySQL Database¿?

mysql> describe Clients;

+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int(11)      | NO   | PRI | NULL    | auto_increment |
| name        | varchar(255) | NO   |     | NULL    |                |
| shurname    | varchar(255) | NO   |     | NULL    |                |
| email       | varchar(255) | NO   |     | NULL    |                |
| password    | varchar(255) | NO   |     | NULL    |                |
| userId      | int(11)      | NO   |     | NULL    |                |
| userMessage | varchar(255) | YES  |     | NULL    |                |
| userName    | varchar(255) | YES  |     | NULL    |                |
| pwd         | varchar(255) | YES  |     | NULL    |                |
| surname     | varchar(255) | YES  |     | NULL    |                |
+-------------+--------------+------+-----+---------+----------------+
10 rows in set (0.00 sec)

mysql> ALTER TABLE Clients DROP userId;
^CCtrl-C -- sending "KILL QUERY 104" to server ...
Ctrl-C -- query aborted.
ERROR 1317 (70100): Query execution was interrupted
mysql> ALTER TABLE Clients DROP userMessage;

And it doesn't finish, it get stuck and don't delete.... I want to delete userId, userMessage, userName, pwd and surname.

有帮助吗?

解决方案 2

I cannot even drop the table being root:

mysql> show tables;
+-------------------------+
| Tables_in_Hoteles_Compu |
+-------------------------+
| Clients                 |
| Coords                  |
| Hotels                  |
| Rate                    |
| Regions                 |
+-------------------------+
5 rows in set (0.00 sec)

mysql> drop table Coords;
Query OK, 0 rows affected (0.04 sec)

mysql> drop table Clients;

其他提示

If you first remove the autoincrement and drop the primary key you should be able to delete the field. Maybe even just removing the autoincrement would do it but not sure. The other fields should delete ok regardless.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top