Day 18: Configure LAMP server: Unable to Connect to 'stdb01'

Hello,
I am getting “Unable to Connect to ‘stdb01’” on the task Configure LAMP server. Below are my setup:

DB Server:
sudo dnf install mariadb-server -y
sudo systemctl enable mariadb
sudo systemctl start mariadb
sudo mysql_secure_installation
CREATE DATABASE kodekloud_db7;
CREATE USER ‘kodekloud_aim’@‘stdb01’ IDENTIFIED BY ‘Rc5C9EyvbU’;
GRANT ALL PRIVILEGES ON kodekloud_db7.* TO ‘kodekloud_aim’@‘stdb01’ IDENTIFIED BY ‘Rc5C9EyvbU’;
FLUSH PRIVILEGES;

When testing with PHP , getting the below error:
PHP Warning: mysqli::__construct(): (HY000/1130): Host ‘stapp01.linux-lamp-stack-v2_db_net’ is not allowed to connect to this MariaDB server in /root/test.php on line 8
Connection failed: Host ‘stapp01.linux-lamp-stack-v2_db_net’ is not allowed to connect to this MariaDB server

I was able to figure out this issue. This was an issue with the DB user Privileges.

CREATE DATABASE kodekloud_db7;
CREATE USER ‘kodekloud_db7’@‘%’ IDENTIFIED BY ‘Rc5C9EyvbU’;
GRANT ALL PRIVILEGES ON kodekloud_db7.* TO ‘kodekloud_db7’@‘%’;
FLUSH PRIVILEGES;
SELECT user, host FROM mysql.user;

Please comment if anyone else have any suggestions.