root@5197f8615e46:/# mysql -uroot
MariaDB [(none)]> select user,host from mysql.user
-> ;
+-------------+-----------+
| User | Host |
+-------------+-----------+
| mariadb.sys | localhost |
| mysql | localhost |
| root | localhost |
+-------------+-----------+
3 rows in set (0.001 sec)
MariaDB [(none)]> set password for 'root'@'%' = password('root');
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> set password for 'root'@'localhost' = password('root');
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> create user 'root'@'%' identified by 'root';
Query OK, 0 rows affected (0.003 sec)
MariaDB [(none)]> select user,host from mysql.user;
+-------------+-----------+
| User | Host |
+-------------+-----------+
| root | % |
| mariadb.sys | localhost |
| mysql | localhost |
| root | localhost |
+-------------+-----------+
4 rows in set (0.001 sec)
MariaDB [(none)]> grant all privileges on *.* to 'root'@'%' with grant option;
Query OK, 0 rows affected (0.002 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)