当前位置:  开发笔记 > 后端 > 正文

尝试启动mysql时,"未知变量'max_connections = 75'"

如何解决《尝试启动mysql时,"未知变量'max_connections=75'"》经验,为你挑选了1个好方法。

我有一个在Linode上安装了1G RAM的虚拟Linux服务器ubuntu 15.10 .关于设置LAMP环境的知识非常有限,所以我只能盲目地按照指南来设置我的网站.我刚刚完成了"为Linode 1GB优化MySQL"的第5步.当我尝试继续下一步并启动mysql来创建数据库时,我收到此错误消息:"unknown variable'max_connections = 75'".

这是我的"my.cnf"的内容:

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
#### Added by me #####
[mysql]
max_connections = 75
max_allowed_packet = 1M
thread_stack = 128K
table_open_cache = 32M
key_buffer_size = 32M

在我修改文件之前,"我添加"评论行下方的任何内容都不存在.我检查了我的mysql verysion,它是5.6+,我能够在修改my.conf文件之前登录mysql.可能问题在于"[mysql]"块,但可能出现什么问题?



1> 小智..:

请将[mysql]编辑为[mysqld]并启动mysql

推荐阅读
N个小灰流_701
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有