The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

mirto (20) [Avatar] Offline
#1
Hi all,
I'm trying the example at page 34. I issued the commands:

docker run --name wp-mysql -e MYSQL_ROOT_PASSWORD=yoursecretpassword -d mysql
docker run --name wordpress --link wp-mysql:mysql -p 10003:80 -d wordpress

but at the URL http://localhost:10003/ I receive the error
Error establishing a database connection

What I'm doing wrong?

Thanks
aidanhs (25) [Avatar] Offline
#2
Hi mirto

Sorry for the slow response - we've been busy with some final editing of the book!

When you're starting up the two images, do you pause between starting the mysql and wordpress one? The mysql container can take a while to start! If you do `docker logs wp-mysql` you should see "mysqld: ready for connections" on the second-to-last line. At that point you can start up the wordpress container.

Aidan