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
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>
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)]>
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