cesarhernandezgt
4/10/2019 - 9:53 PM

Mysql 5.5 Docker

Shows docker run command to boot up a Mysql 5.5 instance and provide basic DDL and DML commands.

docker run -it --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.6

TABASE IF NOT EXISTS demodb;
USE demodb;
DROP TABLE IF EXISTS demodb;

CREATE TABLE demodb (
  id int(11) NOT NULL,
  last_name varchar(45) DEFAULT NULL,
  first_name varchar(45) DEFAULT NULL,
  PRIMARY KEY (id)
);

INSERT INTO demodb (id, last_name,first_name) VALUES (1,'Stone','Joe');

select * from training.demodb;