Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"unknown variable 'max_connections=75'" when trying to start mysql

Tags:

mysql

I have a virtual linux server with 1G RAM installed ubuntu 15.10 on Linode. I have very limited knowledge about setting up LAMP environment, so I could only blindly follow the guides to set up my website. I just finished step 5 in "Optimizing MySQL for a Linode 1GB". When I tried to proceed to the next step and start mysql to create database, I got this error message:"unknown variable 'max_connections=75'".

Here is the content of my "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

Anything below "Added by me" comment line didnt' exist before I modified the file. I checked my mysql verysion, it is 5.6+, and I was able to login mysql before I modified the my.conf file. Apparenly the problem lies in the '[mysql]' block, but what could possibly be wrong?

like image 640
shenkwen Avatar asked Jan 04 '16 17:01

shenkwen


1 Answers

Please edit [mysql] to [mysqld] and start mysql

like image 89
Adarsh Gangadharan Avatar answered Sep 19 '22 18:09

Adarsh Gangadharan