DEV Community

StuartCreed
StuartCreed

Posted on • Updated on

How to set up a MariaDB server with docker on Mac

Create account in docker hub.
install docker from docker hub.
run docker -v to check it is installed

run docker pull mariadb in the terminal to pull in the MariaDB image

Create volume with a volumeName:
docker volume create volumeName

Create container with name containerName that links to volume with volumeName and to run it on port 3307 (you can use port 3306 if nothing is being used by it on your Mac) - note the reference to 3306 is the port inside the docker instance, 3307 is the port used on your local Mac:
run docker run --name containerName-mariadb -e MYSQL_ROOT_PASSWORD=password -v volumeName:/etc/mysql/conf.d -p 3307:3306 -d mariadb:latest

Connect to MariaDB server with table plus

Alt Text

source: https://laracasts.com/series/guest-spotlight/episodes/2

Top comments (0)