max_allowed_packet

程序运行错误提示:

org.springframework.dao.TransientDataAccessResourceException: 
### Error updating database.  Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1482 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.
### The error may involve com.rlglsys.mapper.IRlgl010106Mapper.updateUnit-Inline
### The error occurred while setting parameters
### SQL: UPDATE m_tb04_unit SET                            unit_own             =?,    earnings_nature      =?  ,    unit_manage_scale    =? ,    unit_manage_scale_tow=?,    unit_manage_scale_nm=?,    unit_economic_type   =?,    unit_nature          =?,    unit_nature_tow      =?,    unit_level           =?  ,    industry_plan        =?,    agency_level         =?,    agency_level_tow     =? ,    agency_level_three    =?  ,    unit_scale           =?,    license_no           =?,    establishment_num    =?,    organization_no      =? ,    organization_code    =? ,    unit_address         =?,    offical_scope        =?,    unit_pro             =? ,       hospital_grade       =? ,                hospital_grade_tow   =? ,                   unit_img             =? ,               area_id              =? ,           unit_lower           =?  ,           system_sort          =? ,                   industry_divide      =? ,               system_sort_two      =? ,           industry_divide_two  =?  ,          agency_plan =?  ,    ex_key = ?,      del_kbn = ?,                           expend_01 = ?,           expend_02 = ?,           expend_03 = ?,           expend_04 = ?,           expend_05 = ?,           login_user_id = ?,               login_date = ?,                      update_user_id = ?,             update_date = ?                               WHERE unit_no = ?;
### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1482 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.
; SQL []; Packet for query is too large (1482 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.; nested exception is com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1482 > 1024). You can change this value on the server by setting the max_allowed_packet' variable.


解决方案:

在linux命令栏中:输入:whereis mysql

可以显示mysql的安装目录: /usr/share/mysql

1.找到 【my-default.cnf】文件:把max_allowed_packet = 20M  的值调大些即可。

2.在etc/my.cnf文件中,找到max_allowed_packet设置,默认是1MB,我们可以修改为10MB或者20MB,随意。然后重启网站环境之后再导入数据库命令执行,就可以完全的执行导入数据库。

重新启动mysql:service mysql restart

通过 ps -el | grep mysqld   查看mysql的启动情况。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值