Install and Install Maria DB

yum install mariadb-server
Systemctl start mariadb

Mysql –u root

Create database kodekloud_db9

mysql -u root kodekloud_db9 < /home/peter/db.sql
grant all on kodekloud_db9.* to kodekloud_cap@localhost identified by ‘Password1’;

flush privileges;

image

image

Error when tried to connect from stapp01 after installing mysql client
image

What I’m missing

In wp-config.php file you should use hostname instead of IP address of DB host. Like stdb01:3306.

Hi, Facing same issue even after using stdb01:3306

Do I need to restart any service after updating config file

No need to restart any service

Then why it is failing… Am I missing anything??

I have opened port 3306 in DB server. It worked
/sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT