Hi I had run into mysql crash issue , I would like to lower the InnoDB buffer pool. but there is no setting inside /etc/my.cnf I added innodb_buffer_pool_size = 20M insdide the my.cnf is not working.
my question is where is innodb_buffer_pool_size setting is ? and how I can change this setting thanks
how its done in ubuntu https://www.digitalocean.com/community/questions/mysql-server-keeps-stopping-unexpectedly
this is what currently inside the /etc/my.cnf
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
innodb_buffer_pool_size = 20M
once i restart mysqld
Job for mysqld.service failed because the control process exited with error code.
See "systemctl status mysqld.service" and "journalctl -xe" for details.
its out of memory error
mmap(137363456 bytes) failed; errno 12 Cannot allocate memory for the buffer pool
thanks
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hello there,
In addition to what has already been mentioned, I wanted to point out that CentOS Linux 8 has reached End Of Life (EOL) on December 31st, 2021.
I would strongly recommend planning either migration to another OS like Debian or Ubuntu, or upgrading to CentOS Stream.
I personally believe that the safest way to do this is to follow these steps here:
rsync
for example copy over your files and migrate your databasesRegards, Alex
Hello, @stupidboy
I’d suggest that you add a swap file to give yourself a bit more of a buffer. Check out this tutorial:
https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-20-04
What you can also do is to use the MySQLTuner script.
The MySQLTuner is a script written in Perl and allows you to quickly test your MySQL configuration and it gives you suggestions for adjustments to increase performance and stability.
According to the official GitHub page, it supports 300 indicators for MySQL/MariaDB/Percona Server in this last version.
To run the script you could do the following:
The script would run multiple checks against your MySQL instance, all checks done by MySQLTuner are documented here.
Also as stated in the official documentation, it is still extremely important for you to fully understand each change you make to a MySQL database server. If you don’t understand portions of the script’s output, or if you don’t understand the recommendations, you should consult a knowledgeable DBA or system administrator that you trust.
As a good practice make sure to always test your changes on staging environments before implementing them on your production database.
On the same note, if you want to have a worry-free MySQL hosting and focus on your application, I would recommend trying out the DigitalOcean Managed Databases:
https://www.digitalocean.com/products/managed-databases-mysql/
This was mini tutorial was posted from bobbyiliev in this question in our community: https://www.digitalocean.com/community/questions/how-to-tweak-mysql-mariadb-configuration-for-increased-performance-and-stability
You can also create a simple bash script to check if MySQL is running and if not to restart it.
Run this script every 5 minutes using a cron job like this one:
Hope that this helps! Regards, Alex