如何在mysql中删除外键

时间:2016-10-24 10:25:02

标签: php mysql database phpmyadmin

使用mysql并尝试删除外部约束,但我无法删除该密钥。

SHOW CREATE TABLE xxxx;

它的节目,

CREATE TABLE `xxxx` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `user_id` int(11) NOT NULL,
 `name` text NOT NULL,
 `article_title` text NOT NULL,
 `created_at` datetime NOT NULL,
 `last_modified_at` datetime NOT NULL,
 `latest_version` tinyint(4) NOT NULL,
 `status` tinyint(4) NOT NULL,
 `is_deleted` enum('0','1') NOT NULL,
 `deleted_time` datetime NOT NULL,
 `manual_authorgroup_data` text NOT NULL,
 PRIMARY KEY (`id`),
 KEY `user_id` (`user_id`),
 CONSTRAINT `fk_users_xxxx_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1

如何解决此问题,请帮助我。

1 个答案:

答案 0 :(得分:1)

试试这个,

{
  "private": true,
  "scripts": {
    "prod": "gulp --production",
    "dev": "gulp watch"
  },
  "devDependencies": {
    "gulp": "^3.9.1", 
    "jquery": "^3.1.0",
    "laravel-elixir": "^6.0.0-9",
    "laravel-elixir-browsersync-official": "^1.0.0",
    "laravel-elixir-vue-2": "^0.2.0",
    "laravel-elixir-webpack-official": "^1.0.2",
    "lodash": "^4.16.2",
    "vue": "^2.0.1",
    "vue-resource": "^1.0.3"
  },
  "dependencies": {
    "dropzone": "^4.3.0"
  }
}