I have installed AWS ami ec2 linux instance on AWS, when I try to install mariadb then show the error last metadata expiration check. how can i resolve this isssue?
#!/bin/bash
DATABASE_PASS=’admin123′
sudo yum update -y
sudo yum install epel-release -y
sudo yum install git zip unzip -y
sudo yum install mariadb-server -y
starting & enabling mariadb-server
sudo systemctl start mariadb
sudo systemctl enable mariadb
cd /tmp/
git clone -b main https://github.com/hkhcoder/vprofile-project.git
#restore the dump file for the application
sudo mysqladmin -u root password “$DATABASE_PASS”
sudo mysql -u root -p”$DATABASE_PASS” -e “UPDATE mysql.user SET Password=PASSWORD(‘$DATABASE_PASS’) WHERE User=’root'”
sudo mysql -u root -p”$DATABASE_PASS” -e “DELETE FROM mysql.user WHERE User=’root’ AND Host NOT IN (‘localhost’, ‘127.0.0.1’, ‘::1′)”
sudo mysql -u root -p”$DATABASE_PASS” -e “DELETE FROM mysql.user WHERE User=””
sudo mysql -u root -p”$DATABASE_PASS” -e “DELETE FROM mysql.db WHERE Db=’test’ OR Db=’test_%'”
sudo mysql -u root -p”$DATABASE_PASS” -e “FLUSH PRIVILEGES”
sudo mysql -u root -p”$DATABASE_PASS” -e “create database accounts”
sudo mysql -u root -p”$DATABASE_PASS” -e “grant all privileges on accounts.* TO ‘admin’@’localhost’ identified by ‘admin123′”
sudo mysql -u root -p”$DATABASE_PASS” -e “grant all privileges on accounts.* TO ‘admin’@’%’ identified by ‘admin123′”
sudo mysql -u root -p”$DATABASE_PASS” accounts < /tmp/vprofile-project/src/main/resources/db_backup.sql
sudo mysql -u root -p”$DATABASE_PASS” -e “FLUSH PRIVILEGES”
Restart mariadb-server
sudo systemctl restart mariadb
#starting the firewall and allowing the mariadb to access from port no. 3306
sudo systemctl start firewalld
sudo systemctl enable firewalld
sudo firewall-cmd –get-active-zones
sudo firewall-cmd –zone=public –add-port=3306/tcp –permanent
sudo firewall-cmd –reload
sudo systemctl restart mariadb
sudo systemctl status mariadb
Ghaznfar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.