Author Topic: Update MariaDB >= 10.2  (Read 20109 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Update MariaDB >= 10.2
« on: September 27, 2018, 04:07:06 PM »
I wanna update MariaDB to >= 10.2 or change with MySql >= 5.7.19  (I need support json columns)
Is it possible from Admin panel?
If not will be good if show me some guide for that
Thank You

Offline
*
Re: Update MariaDB >= 10.2
« Reply #1 on: October 01, 2018, 09:04:52 AM »
+1 for me too

Offline
***
Re: Update MariaDB >= 10.2
« Reply #2 on: October 07, 2018, 08:36:39 PM »
CentOS have not that version for MariaDB.
'yum update' install the latest version, that is 10.1.36, for CentOS 7.
(what is your CentOS version?)

But nothing can stop you from install it from sources.
Or install rpms from RHEL7, that possibly will work too.
At yout risk.

RHEL7 have the '10.2.8-5.el7.x86_64.rpm' version available.

Regards,
Netino

Offline
***
Re: Update MariaDB >= 10.2
« Reply #3 on: October 08, 2018, 03:49:58 AM »
CentOS have not that version for MariaDB.
'yum update' install the latest version, that is 10.1.36, for CentOS 7.
(what is your CentOS version?)

But nothing can stop you from install it from sources.
Or install rpms from RHEL7, that possibly will work too.
At yout risk.

RHEL7 have the '10.2.8-5.el7.x86_64.rpm' version available.

Regards,
Netino

First of all MariaDB has it's own repository and is not provided by base CentOS repository.

Quote
yum whatprovides mariadb
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.iitm.ac.in
 * epel: mirror1.ku.ac.th
 * extras: ftp.iitm.ac.in
 * updates: ftp.iitm.ac.in
MariaDB-client-10.1.36-1.el7.centos.x86_64 : MariaDB: a very fast and robust SQL database server
Repo        : mariadb
Matched from:
Provides    : mariadb = 1:10.1.36-1.el7.centos


Below is its repository location.

Quote
cat /etc/yum.repos.d/mariadb.repo

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

This will show you what version of MariaDB is installed. So in our case its 10.1

Quote
rpm -qa | grep -i '^mariadb-'

MariaDB-shared-10.1.36-1.el7.centos.x86_64
MariaDB-compat-10.1.36-1.el7.centos.x86_64
MariaDB-common-10.1.36-1.el7.centos.x86_64
MariaDB-server-10.1.36-1.el7.centos.x86_64
MariaDB-client-10.1.36-1.el7.centos.x86_64

Now if I want to upgrade this I will modify mariadb.repo file and change 10.1 to 10.2

Quote
vi /etc/yum.repos.d/mariadb.repo

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

First I will make full backup of my database if something goes wrong

Code: [Select]
mysqldump --all-databases > /home/fullbackup.sql.gz
Simply go ahead and remove these packages

Code: [Select]
yum remove MariaDB-server MariaDB-client -y
Now install the new latest packages again for version 10.2.

Code: [Select]
yum install MariaDB-server MariaDB-client -y
You can change 10.1 to 10.3 MariaDB repository "/etc/yum.repos.d/mariadb.repo" in if you wish to use that version.

Verify the packages again

Quote
[root@localhost ~]# rpm -qa | grep -i '^mariadb-'
MariaDB-shared-10.2.18-1.el7.centos.x86_64
MariaDB-server-10.2.18-1.el7.centos.x86_64
MariaDB-compat-10.2.18-1.el7.centos.x86_64
MariaDB-common-10.2.18-1.el7.centos.x86_64
MariaDB-client-10.2.18-1.el7.centos.x86_64

Start Mariadb

Code: [Select]
systemctl start mariadb
Upgrade MySQL database for compatibility

Code: [Select]
mysql_upgrade


Offline
***
Re: Update MariaDB >= 10.2
« Reply #4 on: August 19, 2019, 12:54:47 PM »
https://nvd.nist.gov/vuln/detail/CVE-2017-15365?cpeVersion=2.2

Should I attempt to update MariaDB using your method Bullten?

Offline
*
Re: Update MariaDB >= 10.2
« Reply #5 on: September 05, 2019, 07:49:21 AM »
CentOS have not that version for MariaDB.
'yum update' install the latest version, that is 10.1.36, for CentOS 7.
(what is your CentOS version?)

But nothing can stop you from install it from sources.
Or install rpms from RHEL7, that possibly will work too.
At yout risk.

RHEL7 have the '10.2.8-5.el7.x86_64.rpm' version available.

Regards,
Netino

First of all MariaDB has it's own repository and is not provided by base CentOS repository.

Quote
yum whatprovides mariadb
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.iitm.ac.in
 * epel: mirror1.ku.ac.th
 * extras: ftp.iitm.ac.in
 * updates: ftp.iitm.ac.in
MariaDB-client-10.1.36-1.el7.centos.x86_64 : MariaDB: a very fast and robust SQL database server
Repo        : mariadb
Matched from:
Provides    : mariadb = 1:10.1.36-1.el7.centos


Below is its repository location.

Quote
cat /etc/yum.repos.d/mariadb.repo

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

This will show you what version of MariaDB is installed. So in our case its 10.1

Quote
rpm -qa | grep -i '^mariadb-'

MariaDB-shared-10.1.36-1.el7.centos.x86_64
MariaDB-compat-10.1.36-1.el7.centos.x86_64
MariaDB-common-10.1.36-1.el7.centos.x86_64
MariaDB-server-10.1.36-1.el7.centos.x86_64
MariaDB-client-10.1.36-1.el7.centos.x86_64

Now if I want to upgrade this I will modify mariadb.repo file and change 10.1 to 10.2

Quote
vi /etc/yum.repos.d/mariadb.repo

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

First I will make full backup of my database if something goes wrong

Code: [Select]
mysqldump --all-databases > /home/fullbackup.sql.gz
Simply go ahead and remove these packages

Code: [Select]
yum remove MariaDB-server MariaDB-client -y
Now install the new latest packages again for version 10.2.

Code: [Select]
yum install MariaDB-server MariaDB-client -y
You can change 10.1 to 10.3 MariaDB repository "/etc/yum.repos.d/mariadb.repo" in if you wish to use that version.

Verify the packages again

Quote
[root@localhost ~]# rpm -qa | grep -i '^mariadb-'
MariaDB-shared-10.2.18-1.el7.centos.x86_64
MariaDB-server-10.2.18-1.el7.centos.x86_64
MariaDB-compat-10.2.18-1.el7.centos.x86_64
MariaDB-common-10.2.18-1.el7.centos.x86_64
MariaDB-client-10.2.18-1.el7.centos.x86_64

Start Mariadb

Code: [Select]
systemctl start mariadb
Upgrade MySQL database for compatibility

Code: [Select]
mysql_upgrade

this stop mysql start and reformat myserver from zero

Offline
*
Re: Update MariaDB >= 10.2
« Reply #6 on: December 28, 2019, 11:49:52 AM »
You can find all available versions here
http://yum.mariadb.org

Edit MariaDB version you want in this file
 
Quote
/etc/yum.repos.d/MariaDB.repo

run this commands
Quote
mysql
Quote
set global innodb_fast_shutdown = 0;

Back by press Ctrl+c and run this commands
Quote
systemctl stop mysql
Quote
systemctl status mysql

Back up your DB
Quote
cp -r /var/lib/mysql /var/lib/bk

Remove MariaDB
Quote
yum remove mariadb-server

Remove Galera
Quote
yum remove galera*

Install MaraiaDB
Quote
yum --disablerepo=* --enablerepo=MariaDB install mariadb-server

Reboot your system
Quote
reboot

login to your centos web-panel control dashboard

finally, run this command
Quote
mysql_upgrade

Login to your PhpMyAdmin to check MariaDB new version

« Last Edit: December 28, 2019, 11:52:14 AM by ahmedsaoud31 »

Offline
**
Re: Update MariaDB >= 10.2
« Reply #7 on: December 28, 2019, 03:41:48 PM »
I wanna update MariaDB to >= 10.2 or change with MySql >= 5.7.19  (I need support json columns)
Is it possible from Admin panel?
If not will be good if show me some guide for that
Thank You

+1 for me too

 :) Hi "yordanovbg" and "PavelZh",

I have discovered a great website https://www.mysterydata.com/ with a great Administrator with courtesy and extreme availability where you can find many guides for CWP (Centos Web Panel) and CWP PRO (Centos Web Panel Pro) for Centos 7 ! and more.

Also by registering for free on the official MysteryData.com forum https://forum.mysterydata.com/ you can also ask for help to solve this problem or to have help in general also and not only with regard to CWP (Centos Web Panel) and CWP PRO (Centos Web Panel Pro) for Centos 7 !

This is the link of MysteryData website of the guide to Update/Upgrade to the latest and stable version of MariaDB v10.4 for CWP (Centos Web Panel) and CWP PRO (Centos Web Panel Pro) for Centos 7 in a clean and safe way:

https://www.mysterydata.com/update-upgrade-to-mariadb-10-4-on-vestacp-cwp-centos-7/

Bye, good day and good work !
« Last Edit: December 28, 2019, 03:46:09 PM by Automata »


« Stay hungry, stay foolish. »

Offline
***
Re: Update MariaDB >= 10.2
« Reply #8 on: January 04, 2020, 11:11:21 PM »
You can have a problem with systemd daemon, being MySQL service pointed at CWP Dashboard as "No Active".
Checking for "mariadb" service after install, you find nothing.
Seeking for mysql service, you find:
Code: [Select]
# systemctl | grep -i mysql
  mysql.service                                                 loaded active running   LSB: start and stop MariaDB

Checking for the unit existence, you find:
Code: [Select]
# ls -alF /usr/lib/systemd/system/mariadb.service* /usr/share/mysql/systemd/mariadb.service /etc/rc.d/init.d/mysql*
-rwxr-xr-x 1 root root 12192 Dez  4 20:38 /etc/rc.d/init.d/mysql*
lrwxrwxrwx 1 root root    17 Jun 17  2018 /etc/rc.d/init.d/mysqld -> /etc/init.d/mysql*
-rw-r--r-- 1 root root  5157 Dez  4 20:38 /usr/lib/systemd/system/mariadb.service
-rw-r--r-- 1 root root  4513 Out 29  2018 /usr/lib/systemd/system/mariadb.service.rpmsave
-rw-r--r-- 1 root root  5157 Dez  4 20:38 /usr/share/mysql/systemd/mariadb.service

Checking for MySQL with systemctl command:
Code: [Select]
# systemctl status mysql --no-pager
● mysql.service - LSB: start and stop MariaDB
   Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled)
   Active: active (running) since Sáb 2020-01-04 03:33:10 -03; 16h ago
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/mysql.service
           ├─8050 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/painel.edeaas.com.br.pid
           └─8120 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/hostname.err

# systemctl status mysqld --no-pager
● mysqld.service - LSB: start and stop MariaDB
   Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)

For some strange reason, the manual upgrade MariaDB's installation does't auto enable the unit at systemd.
So, to resolve the CWP Dashboard problem, you simply enable mariadb:
Code: [Select]
# systemctl enable mariadb
Created symlink from /etc/systemd/system/mysql.service to /usr/lib/systemd/system/mariadb.service.
Created symlink from /etc/systemd/system/mysqld.service to /usr/lib/systemd/system/mariadb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

Checking for the solution:
Code: [Select]
# systemctl status mysql --no-pager
● mariadb.service - MariaDB 10.2.30 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) (Result: exit-code) since Sáb 2020-01-04 03:33:10 -03; 16h ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
   CGroup: /system.slice/mysql.service
           ├─8050 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/painel.edeaas.com.br.pid
           └─8120 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/hostname.err

# systemctl status mysqld --no-pager
● mariadb.service - MariaDB 10.2.30 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) (Result: exit-code) since Sáb 2020-01-04 03:33:10 -03; 16h ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
   CGroup: /system.slice/mysql.service
           ├─8050 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/painel.edeaas.com.br.pid
           └─8120 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/hostname.err

# systemctl status mariadb --no-pager
● mariadb.service - MariaDB 10.2.30 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) (Result: exit-code) since Sáb 2020-01-04 03:33:10 -03; 16h ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
   CGroup: /system.slice/mysql.service
           ├─8050 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/painel.edeaas.com.br.pid
           └─8120 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/hostname.err


# systemctl status mysql --no-pager
● mariadb.service - MariaDB 10.2.30 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) (Result: exit-code) since Sáb 2020-01-04 03:33:10 -03; 16h ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
   CGroup: /system.slice/mysql.service
           ├─8050 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/painel.edeaas.com.br.pid
           └─8120 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/hostname.err

Regards,
Netino

Offline
***
Re: Update MariaDB >= 10.2
« Reply #9 on: January 06, 2020, 03:02:24 AM »
I'm using OpenVZ7. So, when restart the MariaDB server with above trick, it fails to restart the MariaDB server.

Code: [Select]
# systemctl restart mariadb
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

# systemctl -l status mariadb
● mariadb.service - MariaDB 10.2.30 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─dontprotecthome.conf, limitnofile.conf, migrated-from-my.cnf-settings.conf
   Active: failed (Result: exit-code) since Dom 2020-01-05 19:10:02 -03; 2s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 3081 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=201/NICE)

Jan 05 19:10:02 painel.edeaas.com.br systemd[1]: Starting MariaDB 10.2.30 database server...
Jan 05 19:10:02 painel.edeaas.com.br systemd[3081]: Failed at step NICE spawning /bin/sh: Permission denied
Jan 05 19:10:02 painel.edeaas.com.br systemd[1]: mariadb.service: control process exited, code=exited status=201
Jan 05 19:10:02 painel.edeaas.com.br systemd[1]: Failed to start MariaDB 10.2.30 database server.
Jan 05 19:10:02 painel.edeaas.com.br systemd[1]: Unit mariadb.service entered failed state.
Jan 05 19:10:02 painel.edeaas.com.br systemd[1]: mariadb.service failed.

Running "systemctl disable mysql" didn't solved the problem.
When upgraded MariaDB, I see was created a file "/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf":
Code: [Select]
# converted using /usr/bin/mariadb-service-convert
#

[Service]
Nice=-5

For some reason, I cannot do nice/renice of processes priorities in OpenVZ7, although being root user.
I searched google, but could't find anything to solve this problem.
So, commenting the "Nice" parameter, and solved the problem.
Code: [Select]
# converted using /usr/bin/mariadb-service-convert
#

#[Service]
#Nice=-5

# systemctl -l status mariadb
● mariadb.service - MariaDB 10.2.30 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Dom 2020-01-05 20:16:38 -03; 2h 51min ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 9559 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 9441 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 9440 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 9527 (mysqld)
   Status: "Taking your SQL requests now..."
   CGroup: /system.slice/mariadb.service
           └─9527 /usr/sbin/mysqld --basedir=/usr

I tried too to add "DefaultLimitNICE:-5:-5" to /etc/systemd/system.conf, but the problem persists.
But strangely, I can use "renice" the running processes by changing the process priority with "htop" tool (need to install it).
Seems a problem with sh/bash.

Regards,
Netino