您的位置:首页 > 数据库 > SQL

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

2017-03-23 11:20 423 查看
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
后将下段文本代替之前的[b]my-defailt.ini文本:[/b]
[b]

# 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安装目录。
[/b]
管理员权限运行cmd
输入net stop mysql
net start mysql
两个命令进行重启。
这样就可以解决[b]MySQL system variable 'max_allowed_packet' is set to 1048576
Byte 问题了。
[/b]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐