mysql 命令行

1. 获取外键连接信息

# get foreign key
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA IS not null and table_schema='db name';

2. 清空表

truncate <table name>

3. update时一定要加limit

posted @ 2020-03-14 21:58  redstar9451  阅读(78)  评论(0编辑  收藏  举报