# ###################################################### #
# MariaDB                                                #
#                                                        #
# Database container with MariaDB                        #
# ###################################################### #

Project Structure:
==================

docker-nginx/
├── docker-compose.yml
├── mariadb_data/
│   ├── # Volume for database files


Build & Run:
============

For a first startup: 

  > docker-compose up --build

For a startup:

  > docker-compose up -d


Users:
======
User: resDbUser
Pwd : res#Db!Pwd%765


Config:
=======
User Root Password: root#unl!853
Port: 3406


Create database
===============

  #2 Create database
    > docker exec -it mariadb mariadb -uroot -proot#unl!853 -e "CREATE DATABASE IF NOT EXISTS resilient_resilient;"
      <mariadb>, its the docker container name
      <mariadb>, THE SECOND <mariadb> is the equivalent to mysql command, but for mariadb
      <root#unl!853>, the root password
	  <resilient_resilient>, its the intended database name
	
  #2 Verify
     > docker exec -it mariadb mariadb -uroot -proot#unl!853 -e "SHOW DATABASES;"
  	   <mariadb>, its the docker container name
  	   <mariadb>, THE SECOND <mariadb> is the equivalent to mysql command, but for mariadb
  	   <root#unl!853>, the root password
  	   
Restore from mysqldump
======================

  #1 Copy dump file into the ./dumps directory
       
  #2 Import the dump into the database, without copy the dump into container
     > docker exec -i mariadb mariadb -uroot -proot#unl!853 resilient_resilient < ./dumps/resilient_dump.sql
       <mariadb>, its the docker container name
       <mariadb>, THE SECOND <mariadb> is the equivalent to mysql command, but for mariadb
       <root#unl!853>, the root password
       <resilient_resilient>, its the intended database name
       <resilient_dump.sql>, the dump file name

  #3 Verify (SHOW TABLES;)
     > docker exec -it mariadb mariadb -uresDbUser -pres#Db!Pwd%765 resilient_resilient -e "SHOW TABLES;"
  	   <mariadb>, its the docker container name
  	   <mariadb>, THE SECOND <mariadb> is the equivalent to mysql command, but for mariadb
  	   <resDbUser>, User to use. NOTE: Testing the functional user (not root).
  	   <res#Db!Pwd%765>, The user password. NOTE: Testing the functional user (not root).
	   <resilient_resilient>, its the intended database name
	   
	   