

Query OK, 0 rows affected, 2 warnings (0.00 sec) Mysql> GRANT ALL PRIVILEGES ON wp_db.* TO IDENTIFIED BY "Password1" Type '\c' to clear the current input statement. Other names may be trademarks of their respective owners. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Server version: 5.7.21 MySQL Community Server (GPL)Ĭopyright (c) 2000, 2018, Oracle and/or its affiliates. Once the shell is loaded, use “mysql” command and let’s run some commands to setup the DB/User: bash-4.2# mysql -u root -p The above will allow us to access the shell in “interactive” mode executing the command “/bin/bash”. Use $ docker exec -i -t wp-mysql /bin/bash Now that our MySQL instance is running, lets log into it and setup our database/user. We can see this if we run “docker ps”: $ docker ps | grep wp-mysqlĮ5df33b8a29b mysql/mysql-server "/entrypoint.sh mysq…" 13 seconds ago Up 12 seconds (health: starting) 33060/tcp, 0.0.0.0:33060->3306/tcp wp-mysql Now the container should be up and running.

“ –name“: This is the name of the container we will use to link our web server to.Let’s run our MySQL instance: $ docker run -name wp-mysql -p 33060:3306 -e MYSQL_ROOT_PASSWORD=Password1 -d mysql/mysql-serverĪbove we instantiated a MySQL container with the following parameters: Now we will instantiate a MySQL Docker container which we will use as our database server. Load up terminal and pull the docker image: $ docker pull mysql/mysql-server To begin with, we will setup our database using Docker.

We will be deploying a WordPress website with a MySQL backend. To enable us to use Docker, we will need to install Docker tooling capabilities from Eclipse Marketplace: You will obviously need Eclipse IDE running. You could obviously do pretty much the same using Windows. That is out of scope of this guide however it is fairly easy for beginners to install just like any other Mac OS application from here –.

Rather than converting our local machine into a LAMP (Linux, Apache, MySQL, PHP) server, we will use the power of Docker to spin up and test our code on demand.įirstly, you will need Docker for Mac installed. In this blog I will show you how easy it is to test code locally when using Eclipse IDE on a Mac.
