Debian10: Upgrade MariaDB 10.3 to 10.5

Post Reply
User avatar
myVesta
Site Admin
Posts: 918
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

This is the tutorial Debian10, for upgrading MariaDB 10.3 to 10.5.

First, if you have /home/scanps.php file (you probably don't have it), disable cron.

Code: Select all

crontab -e
# put comment on the beginning of 'scanps' cron if you have it
Now fully upgrade system - read viewtopic.php?f=28&t=270 before doing this.

Code: Select all

apt-get update
apt-get -y --with-new-pkgs upgrade
apt-get -y dist-upgrade
Set up apt repo:

Code: Select all

apt install curl apt-transport-https wget -y
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
chmod +x mariadb_repo_setup
./mariadb_repo_setup --mariadb-server-version="mariadb-10.5"
cp /etc/mysql/mariadb.cnf /etc/mysql/mariadb.cnf-backup
Now let's do main upgrade process:

Code: Select all

apt-get update
apt-get -y --with-new-pkgs upgrade
apt-get -y dist-upgrade
apt install -y mariadb-client-10.5 mariadb-server-10.5
Try to copy old values from /etc/mysql/mariadb.cnf-backup to /etc/mysql/mariadb.cnf

Here is example how final mariadb.conf should looks like:

Code: Select all

# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/

#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
# Port or socket location where to connect
# port = 3306
socket = /run/mysqld/mysqld.sock

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

############ YOUR OLD VALUES FROM mariadb.cnf-backup STARTS HERE ############
[client]
port=3306
socket=/var/run/mysqld/mysqld.sock

[mysqld_safe]
socket=/var/run/mysqld/mysqld.sock

[mysqld]
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
port=3306
basedir=/usr
datadir=/var/lib/mysql
tmpdir=/tmp
lc-messages-dir=/usr/share/mysql
log_error=/var/log/mysql/error.log

symbolic-links=0

skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 128M

sort_buffer_size = 4M
net_buffer_length = 16K
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 128M
# thread_cache_size = 8
# query_cache_size= 16M
# thread_concurrency = 8

#innodb_use_native_aio = 0
innodb_file_per_table

max_connections=200
max_user_connections=50
# wait_timeout=30
interactive_timeout=500
long_query_time=5

table_open_cache = 20480
thread_cache_size = 384
query_cache_size = 50M
# thread_concurrency = 16
wait_timeout = 180
join_buffer_size = 16M
query_cache_type = 1
tmp_table_size = 512M
innodb_buffer_pool_size=4G

open_files_limit = 190000
innodb_open_files = 15000
############ YOUR OLD VALUES FROM mariadb.cnf-backup ENDS HERE ############
At the end, re-download latest version of 'scanps' (if you have /home/scanps.php file)

Code: Select all

wget -nv -O /home/scanps.php https://c.myvestacp.com/tools/scanps/scanps.php
Re-enable it in cron:

Code: Select all

crontab -e
# uncomment 'scanps' cron if you have it

Tags:
Post Reply