czeo.com

Install, Configure and Tune MySQL 8.0 512MB / 1GB RAM Ubuntu

Add 2GB Swap

sudo dd if=/dev/zero of=/swapfile bs=128M count=16
sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile && sudo swapon -s

Add the following line at the bottom of /etc/fstab

/swapfile swap swap defaults 0 0

Install MySQL

sudo apt install mysql-server

Set Root password for MySQL

sudo mysql_secure_installation

Add the following parameter under the tag [mysqld] in the configuration file /etc/mysql/mysql.conf.d/mysqld.cnf

innodb_buffer_pool_size=16M

Restart MySQL

sudo systemctl restart mysql.service