Try sudo nano /etc/mysql/my.cnf
. You have the error editing symbolic links is not permitted
just because /etc/mysql/my.cnf
is only symbolic link to file /etc/alternatives/my.cnf
. Don't use sudoedit
, edit mysql.cnf
with nano
or vim
text editors which are able follow symbolic links.
My suggestion is to select innodb_buffer_pool_size
about 80% of available installed RAM if your RAM less than 8 Gb and 90% if your RAM exeeds 8Gb. Everything depends on your definite situation in particular case. The rule: the larger innodb_buffer_pool_size
the faster MySQL - is true.
Thus, assume you have 8Gb RAM, then 50% of RAM or 4Gb is right choice to start. If this configuration works well, increase this value step by step by 10% up to 80% of RAM. If you'll see that your swap has been used intensively enough, stop to increase this value and decrease it by resonable number.
Finally, open your my.cnf file with nano text editor:
sudo nano /etc/mysql/my.cnf
and add at the end of file new line:
innodb_buffer_pool_size = 4G
Save changes by pressing in nano CTRL+O
-> y
-> Enter
and exit - CTRL+X
.
Restart mysql service to apply new mysql configuration:
sudo systemctl restart mysql.service
That's all.