错误分析:需要给‘php’@‘localhost’用户 REFERENCES 权限。 解决方案: use mysql; grant REFERENCES on php_db.* to 'php'@'%'; 这样操作后,记得重新登录。