用SQL话语不能设置外键——error 1452(23000):cannot add or update a child row:

用SQL语句不能设置外键——error 1452(23000):cannot add or update a child row:....
呵呵,今天又遇到一个错误啦,在做项目的时候出现了这个问题,不知道什么原因。想想是不是因为因为数据库相应的表有值啊?将对应的表清空了后,问题就解决了!呵呵