标签:mysql
知道一个字段名,怎样查到它在数据库里的哪张表里,mysql
USE Information_schema; SELECT TABLE_NAME FROM COLUMNS WHERE COLUMN_NAME=‘字段名称‘;
清空具有外键约束的表时报ERROR 1701(42000)的解决
ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint (`furion`.`tbl_frn_alert`, CONSTRAINT `FK353A3CBEB139CC08` FOREIGN KEY (`endpt_id`) REFERENCES `furion`.`tbl_frn_endpt` (`id`)) #解决方法: mysql> SET foreign_key_checks=0; #删除后 mysql> SET foreign_key_checks=1;
CREATE TABLE users_backup SELECT * FROM users; #创建一个 users 表的备份表
truncate table 表名; #清空一张表
review what i studied `date` - 2017-4-27
标签:mysql
原文地址:http://commonxu.blog.51cto.com/9156074/1920276