Outils pour utilisateurs

Outils du site


mariadb_user

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
mariadb_user [2023/07/05 16:27] – [Création] pascalmariadb_user [2023/07/05 19:13] (Version actuelle) – [Configuration] pascal
Ligne 1: Ligne 1:
 ====== Gestion des utilisateurs mariaDB ====== ====== Gestion des utilisateurs mariaDB ======
-===== Création =====+===== Création d'un user =====
 <code bash> <code bash>
-MariaDB [(none)]> CREATE USER foo@10.% IDENTIFIED BY 'password';+MariaDB [(none)]> CREATE USER foo@'10.%IDENTIFIED BY 'password';
 Query OK, 0 rows affected (0,003 sec) Query OK, 0 rows affected (0,003 sec)
 +</code>
 +<code bash>
 +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
 </code> </code>
 <code bash> <code bash>
Ligne 15: Ligne 22:
 | 10.%      | foo         | *2470C0C02FEE4B9D15ADC618B6DD1900A2EC9E19 | | 10.%      | foo         | *2470C0C02FEE4B9D15ADC618B6DD1900A2EC9E19 |
 +-----------+-------------+-------------------------------------------+ +-----------+-------------+-------------------------------------------+
-rows in set (0,002 sec)+rows in set (0,002 sec)
 </code> </code>
-===== Suppression =====+===== Connexion d'un user ===== 
 +==== 127.0.0.1 ==== 
 +<code bash> 
 +root:~# mariadb -u foo -ppassword 
 +ERROR 1045 (28000): Access denied for user 'foo'@'localhost' (using password: YES) 
 +</code> 
 +==== 10.1.40.1 ==== 
 +<code bash> 
 +root:~# mariadb -u foo -ppassword -h 10.1.40.1 
 +Welcome to the MariaDB monitor.  Commands end with ; or \g. 
 +Your MariaDB connection id is 1350 
 +Server version: 10.11.3-MariaDB-1 Debian 12 
 + 
 +Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. 
 + 
 +Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 
 +</code> 
 +===== Suppression d'un user =====
 <code bash> <code bash>
 MariaDB [(none)]> DROP USER foo@'10.%'; MariaDB [(none)]> DROP USER foo@'10.%';
-Query OK, 0 rows affected (0,003 sec)+Query OK, 0 rows affected (0,002 sec) 
 +</code> 
 +<code bash> 
 +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
 </code> </code>
 <code bash> <code bash>
 MariaDB [mysql]> select Host, User, Password from user; MariaDB [mysql]> select Host, User, Password from user;
-+-----------+-------------+-------------------------------------------+ ++-----------+-------------+----------+ 
-| Host      | User        | Password                                  +| Host      | User        | Password | 
-+-----------+-------------+-------------------------------------------+ ++-----------+-------------+----------+ 
-| localhost | mariadb.sys |                                           +| localhost | mariadb.sys |          
-| localhost | root        | invalid                                   +| localhost | root        | invalid  
-| localhost | mysql       | invalid                                   +| localhost | mysql       | invalid  
-+-----------+-------------+-------------------------------------------+++-----------+-------------+----------+
 3 rows in set (0,002 sec) 3 rows in set (0,002 sec)
 +</code>
 +===== Configuration =====
 +En parallèle, il faut que le serveur accepte les connections venant du réseau local.
 +<code bash file=/etc/mysql/mariadb.conf.d/99-local.cnf>
 +[mysqld]
 +# Instead of skip-networking the default is now to listen only on
 +# localhost which is more compatible and is not less secure.
 +bind-address            = 10.1.40.1
 </code> </code>
 ===== Sources ===== ===== Sources =====
- * [[https://mariadb.com/kb/en/create-user/|Site mariaDB]] +  *[[https://mariadb.com/kb/en/create-user/|create user / Site mariaDB]]  
 +  *[[https://mariadb.com/kb/en/drop-user/|drop user / Site mariaDB]] 
  
  
Ligne 40: Ligne 80:
 ===== Sujets connexes =====  ===== Sujets connexes ===== 
   * [[mariadb|Installation de mariaDB]]   * [[mariadb|Installation de mariaDB]]
 +  * [[mariadb_grant|Gestion des autorisations]]
  
mariadb_user.1688574421.txt.gz · Dernière modification : 2023/07/05 16:27 de pascal