MariaDB [(none)]> CREATE DATABASE auth; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> USE auth; Database changed MariaDB [auth]> CREATE TABLE users ( -> user_name VARCHAR(50) NOT NULL, -> user_passwd VARCHAR(50) NOT NULL, -> PRIMARY KEY (user_name) -> ); Query OK, 0 rows affected (0.42 sec) MariaDB [auth]> GRANT SELECT -> ON auth.users -> TO apache@localhost -> IDENTIFIED BY 'PaSsW0Rd'; Query OK, 0 rows affected (0.32 sec) MariaDB [auth]> exit Bye [root@centos7 ~]# mysql -u root -p -e "INSERT INTO users (user_name, user_passwd) VALUES (\"apache\",\"$(htpasswd -nb apache password |cut -d ':' -f 2)\")" auth Enter password: fenestros [root@centos7 ~]# mysql -u root -p -e "SELECT * FROM auth.users;" Enter password: fenestros +-----------+---------------------------------------+ | user_name | user_passwd | +-----------+---------------------------------------+ | apache | $apr1$isUDg5bK$8oh0oMFUDfL41h84M9vYu1 | +-----------+---------------------------------------+ [root@centos7 ~]#