MySQL Configuration Error – Unknown Variable ‘table_definition_cache=400’

configurationmac os xMySQL

I added lines to ~/.my.cnf which worked fine for weeks. Now I receive complaints when I run myqsl CLI.

System specs:

MAC OS X - El Capitan 10.11.13

Mysql Version:

mysql  Ver 14.14 Distrib 5.6.29, for osx10.11 (x86_64) using  EditLine wrapper

Contents of ~/.my.cnf:

[client]
user = root
password = ***REDACTED***
host = 127.0.0.1

table_definition_cache = 400
table_open_cache = 400

These are the error messages I get when I type 'mysql' in bash:

mysql: unknown variable 'table_definition_cache=400'

mysql: unknown variable 'table_open_cache=400'

I only get the second error message if I comment out the first setting.

I needed these settings because otherwise I get these errors intermittently:

Lost connection to MySQL server at 'sending authentication information', system error: 32

UPDATE:

This link suggested the solution: https://stackoverflow.com/questions/17813630/mysql-5-6-headaches-on-mac-osx

I needed to put the settings in the [mysqld] section of the config file.

Best Answer

In order to solve this please put these configurations under [mysqld] section of config file. For reference check here

[mysqld]
table_definition_cache = 400
table_open_cache = 400