1

We are a free/open source project. We have a CentOS 7 VM and it needed some software updated because the base CentOS 7 is stuck at PHP 5.4 and MediaWiki 1.26. We enabled Software Collections (SCL), which gains access to Apache 2.4, PHP 7.1 and MariaDB 10.2 (and friends).

We are having trouble with the MariaDB 5.5 to 10.2 upgrade which is needed for MediaWiki. We are following mariadb.com's Upgrading from MariaDB 5.5 to MariaDB 10.0. The sticking point is Step 6:

6. Run mysql_upgrade

Running the script results in:

# /opt/rh/rh-mariadb102/root/usr/bin/mysql_upgrade -u root -p
Enter password: xxxxxxxxxxxxxxxxxxxxxx
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
FATAL ERROR: Upgrade failed

We know we have the correct password for the database because we had to recover it earlier in the process. Its a simple copy/paste into the terminal so there are no typos.

We have verified the service is enabled, and its is running:

# systemctl status rh-mariadb102-mariadb.service
* rh-mariadb102-mariadb.service - MariaDB 10.2 database server
   Loaded: loaded (/usr/lib/systemd/system/rh-mariadb102-mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2017-12-21 14:06:26 EST; 8min ago
...

If someone could point out the problem we are having and how to fix it, we would be eternally grateful.

Thank you in advance.


This may have something to with the problem:

# ls /var/lib/mysql/
aria_log.00000001  ibdata1      ib_logfile1  mysql.sock  performance_schema
aria_log_control   ib_logfile0  mysql        my_wiki
[root@ftpit ~]# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 39
Server version: 10.2.8-MariaDB MariaDB Server  
...

MariaDB [(none)]> use my_wiki;
ERROR 1049 (42000): Unknown database 'my_wiki'
MariaDB [(none)]>

However, our my.cnf tells MariaDB to use /var/lib/mysql. The [mysqld] section and data=... was added after the 5.5 to 10.2 migration. The data=... comes from mariadb.com's MariaDB Options:

# cat /etc/opt/rh/rh-mariadb102/my.cnf | grep -v '#'
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

[mysqld]
data=/var/lib/mysql

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

!includedir /etc/opt/rh/rh-mariadb102/my.cnf.d

Here are the prelude steps. They are my field notes for backtracking in case of problems. The steps consist of stopping 5.5 database, writing all data via innodb_fast_shutdown = 0, removing the old 5.5 software, and installing the new 10.2 software.

# https://mariadb.com/kb/en/library/upgrading-from-mariadb-55-to-mariadb-100/
# https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Red_Hat_Linux

systemctl stop mariadb.service

# Recover root password with 'mysqld_safe --skip-grant-tables...' process

yum remove mariadb

yum install rh-mariadb102

/opt/rh/rh-mariadb102/root/usr/bin/mysql_upgrade -u root -p
# The step above failed. Reboot the machine

systemctl enable rh-mariadb102-mariadb.service
systemctl start rh-mariadb102-mariadb.service

/opt/rh/rh-mariadb102/root/usr/bin/mysql_upgrade -u root -p
# The step above failed. Reboot the machine
  • Wrong mysql 'root' password?? – Rick James Dec 27 '17 at 0:24
  • @RickJames - Thanks for following up. We tracked this problem down to hard-coded paths in MariaDB 10.2. Though we changed the datadir in the conf files to use our old DB at /vat/lib/mysql, SCL's MariaDB 10.2 did not honor it. It was using the new DB located at /opt/rh/rh-mariadb102/var/lib (or similar). We gave up on MariaDB 10.2 and uninstalled it. MediaWiki works fine with MariaDB 5.5. – user141074 Dec 27 '17 at 1:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy