Solution:
There is no such variables like memory_limit
in MySQL my.cnf
file. You can add variables only from MySQL server system variables. Read this How Mysql uses memory
It depends on RAM size of your MySQL server. You can configure your my.cnf
file accordingly based on following basic formula for MySQL memory requirement calculation:
key_buffer_size + (read_buffer_size + sort_buffer_size) * max_connections = K bytes of memory
you may need to configure these basic parameters.
Sample variables from my.cnf file:
#MyISAM
key_buffer_size = 8G
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 2M
myisam_sort_buffer_size = 2M
join_buffer_size = 2M
#Innodb
innodb_buffer_pool_size = 16G
innodb_additional_mem_pool_size = 2G
innodb_log_file_size = 1G
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 30
innodb_file_format=barracuda