我有一个在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]"块,但可能出现什么问题?
请将[mysql]编辑为[mysqld]并启动mysql