1449异常 mysql_mysql异常-UncategorizedSQLException 1449

错误:

UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1449];??

解决:

出错的意思是数据库访问时没有‘@’这个用户.这主要是在新建视图和存储过程时,我直截在mysql可视图形工具里copy代码到服务器上去运行,mysql里会自动生成一些代码,比如copy出来的视图语句:

??? DROP VIEW IF EXISTS `testdb`.`v4bbs`;

CREATE OR REPLACE ALGORITHM=UNDEFINED DEFINER=``@`` SQL SECURITY DEFINER VIEW `v4bbs` AS select `a`.`topic_id` AS `did`,`a`.`topic_type` AS `topic_type`,`a`.`especial_flag` AS `topic_level`,`a`.`title` AS `title`,`a`.`url` AS `url`,`a`.`content` AS `content`,concat(`b`.`chinese_name`,_utf8' ',`c`.`chinese_name`,_utf8' ',`d`.`chinese_name`) AS `addr`,`a`.`author_id` AS `author_id`,`e`.`nikename` AS `author_nick`,`a`.`appear_date` AS `pub_time`,`a`.`restor_count` AS `reply`,`a`.`last_restor_user_id` AS `last_reply_id`,`a`.`last_restor_nickName` AS `last_reply_nick`,`a`.`last_restor_date` AS `last_reply_time`,`a`.`last_update_date` AS `last_modify_time`,`a`.`fingerprint` AS `fp` from ((((`tb4topic` `a` join `tb4position` `b`) join `tb4position` `c`) join `tb4position` `d`) join `tb4user` `e`) where ((`a`.`pos_id_1` = `b`.`position_id`) and (`a`.`pos_id_2` = `c`.`position_id`) and (`a`.`pos_id_3` = `d`.`position_id`) and (`a`.`author_id` = `e`.`user_id`) and ((`a`.`state` = 1) or (`a`.`state` = 2)));

应该改成:

??? DROP VIEW IF EXISTS `testdb`.`v4bbs`;

CREATE VIEW `v4bbs` AS select `a`.`topic_id` AS `did`,`a`.`topic_type` AS `topic_type`,`a`.`especial_flag` AS `topic_level`,`a`.`title` AS `title`,`a`.`url` AS `url`,`a`.`content` AS `content`,concat(`b`.`chinese_name`,_utf8' ',`c`.`chinese_name`,_utf8' ',`d`.`chinese_name`) AS `addr`,`a`.`author_id` AS `author_id`,`e`.`nikename` AS `author_nick`,`a`.`appear_date` AS `pub_time`,`a`.`restor_count` AS `reply`,`a`.`last_restor_user_id` AS `last_reply_id`,`a`.`last_restor_nickName` AS `last_reply_nick`,`a`.`last_restor_date` AS `last_reply_time`,`a`.`last_update_date` AS `last_modify_time`,`a`.`fingerprint` AS `fp` from ((((`tb4topic` `a` join `tb4position` `b`) join `tb4position` `c`) join `tb4position` `d`) join `tb4user` `e`) where ((`a`.`pos_id_1` = `b`.`position_id`) and (`a`.`pos_id_2` = `c`.`position_id`) and (`a`.`pos_id_3` = `d`.`position_id`) and (`a`.`author_id`

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值