mysql报错:Cause: com.mysql.jdbc.PacketTooBigException

报错信息:

Error updating database. Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (5872 > 1024). You can change this value on the server by setting the max_allowed_packet‘ variable.

解决办法:

进入MYSQL

输入show variables like ‘%max_allowed_packet%‘;

2.修改配置,我这里设置的是20M

在MYSQL里输入set global max_allowed_packet = 2*1024*1024*10;(20M)

原文地址:

https://blog.csdn.net/qq_33864656/article/details/75006841

 

注意:Tomcat要重启,mysql不用重启

show variables like ‘%max_allowed_packet%‘;

set global max_allowed_packet = 1048576;

修改之后要关闭连接,重新连接mysql,要不然看不到效果

原文地址:https://www.cnblogs.com/zhouheblog/p/9549524.html

时间: 2024-11-16 07:18:50

mysql报错:Cause: com.mysql.jdbc.PacketTooBigException的相关文章

jdbc连接mysql报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'é?‘å?‰æ—­' in 'field list'

解决了中文显示乱码问题之后,又出现了这么一个问题, 思考一下,这绝对是输入文本的问题. 试了一下,果然不出所料. 再次怀疑编码,没有办法, 只有很无奈地去百度了,结果是与编码没有问题啊. sql.execute("insert into reader values('"+rn+"','"+pid+"','"+tele+"','"+kno+"')"); 原来报错是因为我没写单引号,mysql当然不认识啊.OK

Linux环境下mysql报错:bash: mysql: command not found 的解决方法

# mysql -u root-bash: mysql: command not found 原因:这是由于系统默认会查找/usr/bin下的命令. 如果这个命令不在这个目录下,当然会找不到命令. 我们需要做的就是映射一个链接到/usr/bin目录下,相当于建立一个链接文件. # ln -s /usr/local/mysql/bin/mysql /usr/bin 原文地址:https://www.cnblogs.com/ming-4/p/11690947.html

Linux 登录 MySQL 报错, 解决bash: mysql: command not found 的方法

原因:这是由于系统默认会查找/usr/bin下的命令,如果这个命令不在这个目录下,当然会找不到命令,我们需要做的就是映射一个链接到/usr/bin目录下,相当于建立一个链接文件. 首先得知道mysql命令或mysqladmin命令的完整路径,比如mysql的路径是:/usr/local/mysql/bin/mysql,我们则可以这样执行命令: ln -s /usr/local/mysql/bin/mysql /usr/bin 原文地址:https://www.cnblogs.com/zhaina

mysql报错: Unknown character set: 'utf8mb4'

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown character set: 'utf8mb4' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImp

mysql报错this is incompatible with sql_mode=only_full_group_by

1.报错信息 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated query without GROUP BY, expression #2 of SELECT list contains nonaggregated column 'd.total_rated_power_transformer'; this is incompatible with sql_mode=only_full_group_b

连接mysql报错java.sql.SQLException: The server time zone value '?й???????' is unrecognized...解决方法

报错内容: java.sql.SQLException: The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time

遇到的错误:Mysql 报错Duplicate entry '值' for key '字段名'的解决

### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'admin' for key 'user_name_unique' ### The error may involve com.mmall.dao.UserMapper.insert-Inline ### The error occurred

mysql报错问题解决Character set 'utf8mb4' is not a compiled character set

mysql: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file 报错的解决方法 1.由于日常程序使用了字符集utf8mb4,为了避免每次更新时,set names utf8mb4,就把配置文件改了,如下: 增加了mysql客户端的默认字符集设置 [[email protected]~]# vim

解决mysql报错Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

启动mysql 报错: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 1.先查看 /etc/rc.d/init.d/mysqld status 看看m y s q l 是否已经启动.另外看看是不是权限问题. 2.确定你的mysql.sock是不是在那个位置,mysql -u 你的mysql用户名 -p -S /var/lib/mysql/

MySQL报错“1366 - Incorrect integer value: '' XXXXXXX' at row 1 ”

出现这个错误是因为我在表中插入了一条含有中文字符的语句: 修改方法: my.ini中查找sql-mode 将 sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION", 修改为 sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION", 重启mysql后即可 . MySQL报错"1366 - Incorrect int