docker run -d -p 8094:80 -e WORDPRESS_DB_PASSWORD=password -d --name wordpress saiakhil2012/wordpress
Give Basic Information and Press "Install Wordpress" Button
Wait!!! Something is not right!!! It says Database Connection Error
Because wordpress is expecting for a database but it is not present.
So, Let us create a mysql container and try to provide it to wordpress container
docker run --name wordpressdb -p 8095:3306 -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=wordpress -d saiakhil2012/mysql
docker run -p 8099:80 -e WORDPRESS_DB_PASSWORD=password -d --name wordpress --link
wordpressdb:mysql saiakhil2012/wordpress
This time it installs
There is a Hello World Post
docker exec -it wordpressdb /bin/bash
ps -ef| grep mysql
mysql -u root -p
use wordpress;
show tables;
describe wp_posts;
select post_content from wp_posts where post_content like "Welcome to Wordpress%";
update wp_posts set post_content="Welcome to Workshop powered by Huawei" where post_content like "Welcome to Wordpress%";
select post_content from wp_posts where post_content like "Welcome to%";
Check the updated Post Content at the exposed port
Other way round also works (Change in Frontend and Backend it will get reflected)