mysql5.7 opencms安装解决方案 .Your 'max_allowed_packet' variable is set to less than 16777216 Byte (16MB)

opencms安装出现下面的问题:Your‘max_allowed_packet’ variable is set to lessthan 16777216 Byte (16MB).,maxallowedpacket。

一、问题

在安装opencms是会出现如下错误:

MySQL system variable 'max_allowed_packet' is set to 1048576 Byte (1MB). 

Please note that it will not be possible for OpenCms to handle files bigger than this value in the VFS.

Error while checking the server configuration! 

------------------------------------------- 

Your 'max_allowed_packet' variable is set to less than 16777216 Byte (16MB). 

The required value for running OpenCms is at least 16MB.Please change your MySQL configuration (in the my.ini or my.cnf file).

 



解决方案:

首先博主mysql5.7的配置文件名为:my-defailt.ini

我的解决方案是先将my-default.ini改名为my.ini

后将下段文本代替之前的my-defailt.ini文本:



# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[client]


default-character-set=utf8


[mysqld]


# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M


# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin


# These are commonly set, remove the # and set as required.
basedir = C:\mysql-5.7.17-winx64"
datadir = "C:\mysql-5.7.17-winx64\data"
tmpdir = "C:\mysql-5.7.17-winx64\data"
socket = "C:\mysql-5.7.17-winx64\data\mysql.sock"
port = 3306


log-error = "C:\mysql-5.7.17-winx64\data\mysql_error.log"


# server_id = .....


max_connections = 100
table_open_cache = 256
query_cache_size = 1M


tmp_table_size = 32M
thread_cache_size = 8


innodb_data_home_dir = "C:\mysql-5.7.17-winx64\data\"
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 128M
innodb_buffer_pool_size = 128M
innodb_log_file_size = 10M
innodb_thread_concurrency = 16
innodb-autoextend-increment = 1000


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
join_buffer_size = 128M
sort_buffer_size = 32M
read_rnd_buffer_size = 32M


max_allowed_packet = 32M
explicit_defaults_for_timestamp = true


sql_mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

其中将路径都改为自己的mysql安装目录。

管理员权限运行cmd

输入net stop mysql

net start mysql

两个命令进行重启。

这样就可以解决MySQL system variable 'max_allowed_packet' is set to 1048576 Byte 问题了。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

拦路雨g

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值