duanqi5114 2014-06-18 14:25
浏览 33

有关MySQL errno的更多详细信息:150

I'm using PHP's PDO driver/API/library to create some tables in MySQL. When MySQL can't create a table due to a foreign key constraint problem, it returns the following error

Can't create table 'dbname.table_name' (errno: 150)

Is there anyway to have MySQL tell you (or to automatically lookup/analyze) why it couldn't create the table. For example, if you attempt to create a table with 10 foreign keys, and one key is invalid, is there a way to have MySQL tell you which one is the problematic key? Or do you need to rely on human intelligence and debugging to figure this out for yourself?

  • 写回答

1条回答 默认 最新

  • douya1974 2014-07-15 17:03
    关注

    The closest I've been able to come on this is using the perror command

    It won't give fine grained details, but it will give you a plain english explanation of the error code.

    $ perror 150
    MySQL error code 150: Foreign key constraint is incorrectly formed
    
    $ perror 151
    MySQL error code 151: Cannot add a child row
    
    评论

报告相同问题?

悬赏问题

  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错