MariaDB
MariaDB est développé par Michael Widenius, l'auteur du code MySQL original et le fondateur de MySQL AB, dans un projet lancé par forking MySQL, qui appartient désormais à Oracle. La licence de distribution est la version 2 de la licence publique générale GNU. Le nom de MariaDB est tiré du nom de la deuxième fille de Widenius. Wikipédia
MySQL on Raspberry Pi OS ? Il n'y en a pas.
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>
L'utilisateur root est authentifié à l'aide du plug-in unix_sokect. Vous ne pouvez pas vous connecter à moins que l'utilisateur Linux et l'utilisateur SQL ne soient identiques.
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 | <<<<ce
+------+-----------+-------------+
1 row in set (0.001 sec)
Ci-dessous, les paramètres d'invalidation.
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