Linux Notes: MySQL - MariaDB

  1. The information presented here is intended for educational use by qualified computer technologists.
  2. The information presented here is provided free of charge, as-is, with no warranty of any kind.
Edit: 2026-01-31 (this new page is still under construction)

Introduction (some items copied from OpenVMS pages)

Relational Database Caveat: (please read all items in this disclaimer before continuing)
  • DB2 and Oracle-DB represent the BMW and Mercedes Benz of the enterprise database industry. You will not find anything better.
  • However, most charities, students, and small businesses can only afford Volkswagens and this is where MySQL and MariaDB are popular.
  • If your organization has any kind of annual IS/IT budget then you should stick with Oracle-Rdb (OpenVMS only) or Oracle-DB (all platforms) and should pay for annual support.
  • If you do not have the skills to fix problems yourself, or cannot tolerate problems lasting days-to-weeks, then you should never depend upon open source software without some kind of active support contract. Why? Open source developers do not worry about things like: "who answers the call when Joe is on vacation?" or "Joe just perished in a traffic accident". People who sell support contracts do worry about such things. On top of this, I have seen boundary issues in open source software go unanswered for years. What "you may think is an important problem" might be ignored by the rest of the user community.
  • MySQL support contracts are available from other companies including Oracle
  • MariaDB support contracts are available from other companies including MariaDB Corporation Ab
  • Did you know that Wikipedia has employed MariaDB since 2013?

Why relational databases?

Relational databases are "relational in both time and space"
Consider the following example from Oracle 9i

  1. Alice and Bob are bank employees accessing a database consisting of one million accounts.
  2. At 9:00, Alice begins generating a financial report which will take 2 minutes to execute (caveat: must be a read-only select)
  3. At 9:01, Alice's report generator is halfway through the database.
  4. Now, Bob performs a transaction moving $25 from the first account to the last account then commits his changes before Alice's report is finished.
  5. In ISAM technology the $25 would be counted twice in Alice's report. Once on the first record and a second time on the last.
  6. In a relational technology (with transaction support) Alice will not see any of Bob's changes because:
    • all of Bob's before/after information is stored in the rollback segments (UNDO tables) along with the transaction time.
    • When fetching Alice's report data, the engine will use the start time of her transactional query as a key while watching the UNDO tables to ensure she sees the data as it was when she submitted the query at 9:00.
    • It's as if Alice sees a "snapshot" of the whole database taken at 9:00, and "snapshot" is exactly what the file is called in Oracle-Rdb

MySQL

History (10k view)

A few technical details

MariaDB

History (10k view)

A few technical details

Linux-specific stuff

Caveat: By using either YUM or DNF (on enterprise Linux distros like RHEL) or APT (on Debian-based distros), it is possible to inadvertently update update your database engine. This has been known to cause some grief so never do this unless you perform the backup-update-upgrade ritual (see Engine Update below). This means that you must never do wild-card Linux updates. It is better to do selective updates like so:
# showing the recipe for YUM-based Linux distros
# note: on new systems, executing 'yum' will invoke 'dnf'
# This was done as to not break installation scripts
# -------------------------------------------------------
sudo yum clean all
sudo yum make cache
# see what could be updated
sudo yum check-update
# if you see updates for packages beginning with a, b, c
sudo yum update a\* b\* c\*
# if you see updates for packages beginning with d, e, f sudo yum update d\* e\* f\*
# only update the kernel if you are prepared to do a reboot
sudo yum update ker\*
reboot

Initial Install (both client + server)

# ensure the optional epel repo is available
sudo yum list \*epel-release\*
# install epel
sudo yum install epel-release
#
sudo yum clean all
sudo yum makecache
sudo yum list mariadb\*
sudo yum install mariadb

Engine Update

# backup all of your databases (just in case)
mysqldump --user=neil --password=SuperSecret --all-databases --result-file=db_all_v04.sql
# -------------------------------
# now update your database engine (first two steps are optional)
sudo yum clean all
sudo yum makecache
# see what should be updated
sudo yum check-update
# update mariadb client + server packages
sudo yum update mariadb
# -------------------------------
# now run the database repair tool
# /usr/bin/mysql_upgrade --force -uroot -h127.0.0.1 -p

CLI Examples


 Back to Home
Neil Rieck
Waterloo, Ontario, Canada.