[root@kvm3 ~]# mariadb -uroot Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 5 Server version: 10.5.16-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)]> quit Bye
[root@kvm3 ~]# mariadb -uroot Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 31 Server version: 10.5.16-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)]> alter user 'root'@'localhost' identified by '123qwe'; Query OK, 0 rows affected (0.067 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.052 sec) MariaDB [(none)]> quit; Bye
[root@kvm3 ~]# mariadb -uroot ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@kvm3 ~]# mariadb -uroot -p123qwe Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 33 Server version: 10.5.16-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)]> quit Bye