Bonjour,
les utilisateurs mariadb sont traités indépendamment des utilisateurs unix.
Pourtant en root, sans mot de passe (le root mariadb à un mot de passe) on peut se connecter sur une base et modifier les données.
Est-ce un comportement nouveau ?
Cela retire beaucoup de la sécurité de la base de donnée !
# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 10.5.9-MariaDB MariaDB Server
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)]> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| caisse |
| information_schema |
| mysql |
| performance_schema |
+--------------------+
7 rows in set (0.004 sec)
MariaDB [(none)]> USE caisse
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 [caisse]> UPDATE Titres SET tit_nom = 125531 WHERE tit_id = 38;
Query OK, 1 row affected (0.005 sec)
Rows matched: 1 Changed: 1 Warnings:
donc pas besoin de passer par
mysqld_safe --skip-grant-tables --skip-networking & pour changer le mot de passe root :
# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.5.9-MariaDB MariaDB Server
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)]> UPDATE mysql.user SET Password=PASSWORD('Palelrome') WHERE User='root';
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
MariaDB [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.029 sec)]
$ mysql -uroot -p123456
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 10.5.9-MariaDB MariaDB Server
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)]>
Ceci a été fait après la définition du mot de passe root par # mysql_secure_installation, il y avait donc un mot de passe.
Par contre je ne peux le refaire après m'être déconnecté, il y a toujours une demande de mot de passe
# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
C'est visiblement un défaut...
Gérard