Install MariaDB on Raspberry Pi OS

MariaDB

MariaDB is being developed by a project launched by Michael Widenius, the author of the original code for MySQL and the founder of MySQL AB, forking MySQL, which is now owned by Oracle. The distribution license is version 2 of the GNU General Public License. MariaDB's name is taken from the name of Widenius' second daughter. Wikipedia

MySQL on Raspberry Pi OS ? There is none.

pi@raspberrypi:~ $ sudo apt install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  mariadb-server-10.0

E: Package 'mysql-server' has no installation candidate

Install MariaDB

pi@raspberrypi:~ $ sudo apt install mariadb-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
<snip>
Processing triggers for systemd (241-7~deb10u4+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10+rpi1) ...
pi@raspberrypi:~ $ mariadb -V
mariadb  Ver 15.1 Distrib 10.3.23-MariaDB, for debian-linux-gnueabihf (armv7l) using readline 5.2

root password setting


pi@raspberrypi:~ $ sudo mysql_secure_installation
<snip>
Enter current password for root (enter for none):
OK, successfully used password, moving on...
<snip>
Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!
<snip>
Remove anonymous users? [Y/n] y
<snip>
Disallow root login remotely? [Y/n] n
<snip>
Remove test database and access to it? [Y/n] y
<snip>
Reload privilege tables now? [Y/n] y
<snip>

Disabling the unix_sokect plugin

The root user is authenticated using the unix_sokect plugin. You must be the same Linux user and SQL user to log in.

pi@raspberrypi:~ $ sudo mysql -u root
<snip>
MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> SELECT User, Host, plugin FROM user;
+------+-----------+-------------+
| User | Host      | plugin      |
+------+-----------+-------------+
| root | localhost | unix_socket | <<<<this
+------+-----------+-------------+
1 row in set (0.001 sec)

Below, invalidation settings.

MariaDB [mysql]> USE mysql;
Database changed
MariaDB [mysql]> UPDATE user SET plugin='' WHERE User='root';
Query OK, 1 row affected (0.001 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [mysql]> exit
Bye
pi@raspberrypi:~ $ sudo systemctl restart mysql
pi@raspberrypi:~ $  mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.3.23-MariaDB-0+deb10u1 Raspbian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

environment

pi@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 10 (buster)
Release:	10
Codename:	buster
pi@raspberrypi:~ $ cat /proc/device-tree/model
Raspberry Pi 4 Model B Rev 1.2

Recommended Posts

Install MariaDB on Raspberry Pi OS
Install Docker on Raspberry Pi
Install Docker on Raspberry Pi 4 and Raspberry Pi OS 64bit
Headless install of Ubuntu 20.10 on Raspberry Pi
Install CentOS 7 on Raspberry pi 4 Model B
Install Ubuntu Core 18 on Raspberry Pi 2 Model B
Put Ubuntu 20.04.1 on Raspberry Pi 4
Minecraft server on Raspberry Pi 4
Try putting CentOS 8 on Raspberry Pi 3
Note: setting javaMail on Raspberry Pi
How to install MariaDB 10.4 on CentOS 8
Install Cloud9 on Raspberry pi 4 and set up Rails development environment
Install Docker and docker-compose on Raspberry Pi 4, Linux (Debian) and Windows 10, respectively
I installed Docker on my Raspberry Pi 3
Launched Redmine with Docker on Raspberry Pi 3
Serially connect to Ubuntu on Raspberry Pi
Install MariaDB (CentOS 8)
Radiko recording server on Raspberry Pi 4 (Docker unused)
I couldn't install docker with raspberry pi2 b +.
Send emails using Docker container on Raspberry Pi 3
Install gradle on mac
Build Ubuntu 20.04 LTS desktop environment on Raspberry Pi 4 (+ Japanese)
Install Corretto 8 on Windows
Install OpenJDK on macOS
How to run javafx with Raspberry Pi Posted on 2020/07/12
Install Java on Mac
Install Golang on CentOS 8
Install pyqt5 on ubuntu
Install Neo4j 4.1.3 on centOS
Install Docker on Manjaro
Install Vertica 10.0 on CentOS 6.10
Install Ruby on Ubuntu 20.04
Install PostgreSQL 12 on Centos8
Install nginx on centOS7
Install lombok on SpringToolSuite4
Install Python 3 on CentOS 7
Install kuromoji on CentOS7
Display characters on I2C 1602 LCD with Raspberry Pi 3 & Java
Install Autoware on Ubuntu 18.04.5
Install Mattermost on CentOS 7
Install PostGIS 2.5.5 on CentOS7
Install jpndistrict on CentOS 7
Install openjdk11 on mac
Install Homebrew on Ubuntu 20.04
Install Redmine 4.1.1 on CentOS 7
Install OpenJDK 8 on mac
Smokeping Install on CentOS7
Install PostgreSQL 13 on CentOS 7.5
The key to running Docker on Raspberry Pi 4 (Ubuntu server 20.04)
Install Docker on Windows 10 PRO
Install OpenJDK7 (JAVA) on ubuntu 14.04
Install Cybozu Office 10 on Ubuntu 20.4
Install Docker on Ubuntu Server 20.04
Install Sidekiq pro on Rails
Install rbenv on Amazon Linux
Install zabbix agent (5.0) on Ubuntu 18.04
Install MAV Proxy on Ubuntu 18.04
Install tomcat on Sakura's VPS
Install OpenFOAM v2006 on CentOS
Install Arudino IDE on Ubuntu 20
Install Java on WSL Ubuntu 18.04