User Tools

Site Tools


dndwebapp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
dndwebapp [2020/02/28 13:50]
chasty2 [Back End Documentation]
dndwebapp [2020/02/28 15:11] (current)
chasty2 [Back End Documentation]
Line 44: Line 44:
 ## Enter these commands in bash on a Linux environment. ## Enter these commands in bash on a Linux environment.
  
-## Pull mysql 5.7 docker image (mysql 8 works, but a bugfix is needed).+## create ​docker image from dockerfile and run it. Must be in initDB directory to build lug-mysql image 
 +docker build -t lug-mysql . 
 +docker run -d --name=lugdb -e MYSQL_ROOT_PASSWORD=test -p 3306:3306 lug-mysql
  
-docker ​pull mysql:5.7+## delete image and instance if you need to rebuild  
 +docker ​rm lugdb 
 +docker image rm lug-mysql
  
-## Insert iptables firewall rule for docker container at port 3306 and save. Note that the docker daemon must be started after iptables is running. If iptables or a firewall is not running this is not necessary.  +## enter mysql  
- +docker exec -it lugdb mysql -uroot ​-p  
-iptables -A INPUT -i docker0 -p tcp -m tcp --dport 3306 -j ACCEPT +
- +
-service iptables save +
- +
-## create and start docker image +
- +
-docker run -d --name=lugdb -e MYSQL_ROOT_PASSWORD=test -e MYSQL_DATABASE=lugdb -p 3306:​3306 ​mysql:5.7 +
- +
-## enter container +
- +
-docker exec -it lugdb -p +
- +
-## (in mysql) Create accounts table. +
- +
-use lugdb +
- +
-CREATE TABLE account(id INT NOT NULL AUTO_INCREMENT,​ accountName VARCHAR(20) NOT NULL, password VARCHAR(100) NOT NULL, email VARCHAR(254) NOT NULL, PRIMARY KEY (id)); +
- +
-## (in mysql) Show table. +
- +
-SELECT * from account; +
- +
-## (in myqsl) Exit the container. +
- +
-quit+
 </​code>​ </​code>​
 ===== Meeting Notes===== ===== Meeting Notes=====
dndwebapp.txt · Last modified: 2020/02/28 15:11 by chasty2