Install and Configure DB Server Kodekloud



Login to db server [email protected]

Then login as root

sudo su

Now, run these commands

sudo yum install -y mariadb-server

sudo yum install -y mariadb*

systemctl restart mariadb

sudo systemctl enable mariadb && systemctl start mariadb && systemctl status mariadb

sudo mysql_secure_installation

Now, login with root password that you have given and grant permission

mysql -u root -p
create database kodekloud_db9;
create user 'kodekloud_aim'@localhost identified by 'pass';
grant all on kodekloud_db9.* to 'kodekloud_aim' identified by 'pass' WITH GRANT OPTION;
grant all privileges on kodekloud_db9.* to 'kodekloud_aim'@'%' WITH GRANT OPTION;
vi /etc/my.cnf
Now install openssh clients

yum install httpd -y

yum install openssh-clients

Go to jump server and also install openssh clients. Now copy db.sql from jump server to db server

scp  /home/thor/db.sql [email protected]:/tmp

Go  to db server and import db.sql to created datatbase

mysql -u kodekloud_aim -p kodekloud_db9 < /tmp/db.sql

systemctl restart mariadb

Check from server

mysql -u kodekloud_aim -p -h stdb01
mysql -u kodekloud_aim -p -h localhost

Next go to storage server and login as root

Now check the configuration

cat /data/wp-config.php | grep DB_NAME
cat /data/wp-config.php | grep DB_USER
cat /data/wp-config.php | grep DB_PASSWORD
cat /data/wp-config.php | grep DB_HOST

Replace with correct configuration

sudo sed -i 's/dbname/kodekloud_db7/g' /data/wp-config.php
sudo sed -i 's/dbuser/kodekloud_top/g' /data/wp-config.php
sudo sed -i 's/dbpass/pass/g' /data/wp-config.php
sudo sed -i 's/dbhost/stdb01/g' /data/wp-config.php
Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment


Post a Comment