Install and Configure DB Server - Maria DB and PHP configuration

I did following steps as per the requirement:

yum install -y mariadb*

mysql_secure_installation

mysql -u root -p

create database kodekloud_db8;
create user ‘kodekloud_pop’@localhost identified by ‘pass’;
grant all on kodekloud_db8.* to ‘kodekloud_pop’ identified by ‘pass’ WITH GRANT OPTION;
grant all privileges on kodekloud_db8.* to ‘kodekloud_pop’@‘%’ WITH GRANT OPTION;

FLUSH PRIVILEGES;

vi /etc/my.cnf
bind-address=172.16.239.10
port=3306

mysql -u kodekloud_pop -p kodekloud_db8 < /tmp/db.sql

systemctl restart mariadb

sed -i ‘s/dbname/kodekloud_db8/g’ /data/wp-config.php
sed -i ‘s/dbuser/kodekloud_pop/g’ /data/wp-config.php
sed -i ‘s/dbpass/pass/g’ /data/wp-config.php
sed -i ‘s/dbhost/stdb01.stratos.xfusioncorp.com/g’ /data/wp-config.php

I tried opening host on terminal but it was not processing further. And I failed with error:

  • ‘kodekloud_pop’ user not found in ‘wp-config.php’ on Storage Server

If user wont have been there , it should have given the error: error in connecting the database.

Please help.

@mayankagrwl You should make sure to verify the website if working either using LBR URL or uing curl etc before submitting your task. If website is not working due to any mistake it was supposed to be failed. Please try again to resolve this task.

Issue was with the storage server, it was not able to ping database server. After making changes in /etc/hosts file issue got resolved.