Install and Configure DB Server. Wordpress

I install mariadb , active it. create specific user and grant all permission to him. also recoverty db but task still failed. also change php file as asked on storage server.
here is screenshot

when open port 80 it show me wordpres setting page. Why task failed

Hello, lovejoi
what is the error message?

website is not setup correctly as its not working on LBR URL

Hi my task too failed with the same error…even though webiste opened in lbr host on port 80.

@lovejoi In this question I think you were given an existing DB dump to import, from your screenshot it seems like its the default Wordpress installation as using existing db dump you should be able to access the pre-built website.

@Inderpreet Could you please help to check why this task is failed for me.I hope i have configured correctly
Task details:


task failure message:

But able to see the username is correct in that file

image

Even able to connect mysql and able to see the site details

Thanks in Advance

@Inderpreet Any update on this?

@Inderpreet could you help to check this

Hello, @JP1986
Can you please provide them a time? They will view your issue. Don’t worry.

@Tej-Singh-Rana sure Tej.Understood

@Tej-Singh-Rana @Inderpreet - Today again i got the same task.Please let me know what to do.Do you want me to continue?I’m worrying if it fails again with same issue

@JP1986 Sorry for delayed response, what is your KKE username / email ID ?

@Inderpreet - my email id - [email protected]

@JP1986 This is marked pending for you, please try again.

@Inderpreet Hi Inderpreet,

Still it is failing.Please find the details

file:///home/jp/Pictures/Selection_027.png

file:///home/jp/Pictures/Selection_030.png

file:///home/jp/Pictures/Selection_028.png

file:///home/jp/Pictures/Selection_033.png

@Inderpreet - sorry please find the snaps

Selection_032 Selection_030

@Inderpreet 2 tasks failed with same issue and both are having correct username in php file.Already gave screeshots for 1 task.Please find teh screeshots for second task as well

Selection_035

@Inderpreet Any update on this?

Mariadb is the fork of MysqlDB. So you see similar commands to install MysqlDB and MariaDB

C- Let’s Copy the file from Jump host to DB home folder:-

thor@jump_host ~$ sftp peter@stdb01
peter@stdb01’s password:
Connected to stdb01.
db.sql
sftp> put db.sql
Uploading db.sql to /home/peter/db.sql
db.sql 100% 45KB 19.4MB/s 00:00
sftp> exit

@@@@Login into DB Server@@@@@@@@@@@@
############################################################################################################################
ssh peter@stdb01

A- Configure Maria DB Server:-

yum install mariadb-server
systemctl enable --now mariadb

shell command:
#mysql_secure_installiation
set root password: Y
– type your root password twice
– Accept all remaning questions as yes : Y
– Remove anonymous users – Y
– Disallow login to root remotely – y
– Remove Test DB – Y
– Reload privileage tables – Y

  • Test your password and DB
    #mysql -u root -p
    enter root password when prompt

MariaDB[(none)]> show databases;
##############################################################################################################################
B- Create DB:

#mysql -u root -p
MariaDB[(none)]> CREATE DATABASE kodekloud_db6 CHARACTER SET utf8 COLLATE utf8_bin;

*****you need to exit mariadb console (quit) to run restore DB Script *:
Restore db: (we are going to use the file we copied to home folder)
#mysql -uroot -p kodekloud_db6 < /home/peter/db.sql

################################################################################
D- Create DB user

#mysql -u root -p
MariaDB[(none)]>CREATE USER ‘kodekloud_sam’@‘%’ IDENTIFIED BY ‘yourpassword’;
MariaDB[(none)]>FLUSH PRIVILEGES;

#################################################################################
E- Grant full permissions:

#mysql -u root -p
MariaDB[(none)]>GRANT ALL PRIVILEGES ON kodekloud_db6.* TO ‘kodekloud_sam’@‘%’ identified by ‘yourpassword’;
MariaDB[(none)]>FLUSH PRIVILEGES;
MariaDB[(none)]>quit;

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

#systemctl restart mariadb
#systemctl status mariadb

#################################################################################
F- Update config file

— > login to storage server:
ssh natasha@ststor01

sudo sed -i ‘s/dbname/kodekloud_db6/g’ /data/wp-config.php
sudo sed -i ‘s/dbuser/kodekloud_sam/g’ /data/wp-config.php
sudo sed -i ‘s/dbpass/yourpassword/g’ /data/wp-config.php
sudo sed -i ‘s/dbhost/stdb01/g’ /data/wp-config.php

Testing using the + icon using 80 port you should see a website up.

Thank you
Jay

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

Hi @JP1986

This is marked success for you.