mysql: unknown variable 'key_buffer = 16M'

1

On Linux, through the command line, when I try to login with:

mysql -u root -p

You should receive the prompt :

Enter password:

But instead I get the error:

mysql: unknown variable 'key_buffer=16M'

Where does this error originate and how can I solve it?

If relevant the server runs Ubuntu need (12.04.1 LTS) with MySQL 5.5.37.

    
asked by anonymous 13.01.2015 / 20:06

2 answers

3

In addition to the hint / solution presented by @ AndréRibeiro , after some tests, I could observe that:

Checking my.cnf locations

There is no method to find where the my.cnf file is located, but the common locations are:

/etc/my.cnf
/etc/mysql/my.cnf          (no meu caso estava aqui)
$MYSQL_HOME/my.cnf
[datadir]/my.cnf
~/.my.cnf

Source: link

Find correct variable name

Effectively, not knowing whether the variable was correct or not, and given the error itself to suggest that the variable is unknown, through phpMyAdmin I ran the following command:

SHOW VARIABLES LIKE '%key_buffer%';

Having obtained the variable name key_buffer_size with the value 8388608 .

Source: link

Documentation

In depth, the documentation references key_buffer_size , a bit strange because my.cnf on this and other servers is with key_buffer . I assume this is some MySQL change, with my.cnf outdated.

The problem has been overcome by changing the name of key_buffer to key_buffer_size .

    
13.01.2015 / 21:00
0

Go to /etc/my.cnf , search for "key_buffer" and comment the line. Try again and you'll see that it works out.

If you give, go to the line (s) above your "key_buffer" and see if something is typed wrong.

    
13.01.2015 / 20:10