User Tools

Site Tools


wiki:mariadb_reenable_password_authentication

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:mariadb_reenable_password_authentication [2021/03/08 15:53] – created antisawiki:mariadb_reenable_password_authentication [2022/01/20 12:47] (current) – add Debian 11 instructions antisa
Line 2: Line 2:
  
 ====== mariadb reenable password authentication ====== ====== mariadb reenable password authentication ======
-===== Disable unix socket authentication =====+===== Debian 10 =====  
 + 
 +==== Disable unix socket authentication ====
   update mysql.user set plugin='' where user='root';   update mysql.user set plugin='' where user='root';
   flush privileges;   flush privileges;
  
-===== Update password =====+==== Update password ====
   update mysql.user set password=password('yourpasswd') where user='root';   update mysql.user set password=password('yourpasswd') where user='root';
  
Line 12: Line 14:
  
  
-===== Check =====+==== Check ====
   select user,host,password,plugin from mysql.user;   select user,host,password,plugin from mysql.user;
   MariaDB [(none)]> select user,host,password,plugin from mysql.user;   MariaDB [(none)]> select user,host,password,plugin from mysql.user;
Line 20: Line 22:
   | root | localhost | *C3F43AFF2CF6AACD60EE1AAB1B48ADB3066E0EA4 |        |   | root | localhost | *C3F43AFF2CF6AACD60EE1AAB1B48ADB3066E0EA4 |        |
   +------+-----------+-------------------------------------------+--------+   +------+-----------+-------------------------------------------+--------+
 +
 +===== Debian 11 =====
 +
 +This will disable unix socket authentication as well as set the password to 'root':
 +  ~# mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD ('root');"
 +
 +==== Check ====
 +
 +<code sql>
 +MariaDB [(none)]> show create user root@localhost;
 ++---------------------------------------------------------------------------------------------------+
 +| CREATE USER for root@localhost                                                                    |
 ++---------------------------------------------------------------------------------------------------+
 +| CREATE USER `root`@`localhost` IDENTIFIED BY PASSWORD '*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B' |
 ++---------------------------------------------------------------------------------------------------+
 +1 row in set (0.001 sec)
 +</code>
 ====== Tested on ====== ====== Tested on ======
-  * Debian 10.8 +  * Debian 10.810.3.27-MariaDB-0+deb10u1 
-  * 10.3.27-MariaDB-0+deb10u1+  * Debian 11. 10.5.12-MariaDB-0+deb11u1 Debian 11
  
 ====== See also ====== ====== See also ======
wiki/mariadb_reenable_password_authentication.1615215196.txt.gz · Last modified: 2021/03/08 15:53 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki