For the sake of uniformity and smooth experience, you can install MySQL using Containers.

Step 1

Install Docker Engine:

Ubuntu

Mac

Windows

<aside> 💡 Use sudo after this point if you are having authentication errors

</aside>

<aside> 💡 If you don't want to add sudo before every instruction head to this tutorial.

</aside>

Step 2

Install MySQL Server Docker Image

docker pull ubuntu/mysql

Step 3

To start a new Docker container for a MySQL Server

docker run --name=<container_name> -p 30306:3306 -e MYSQL_ROOT_PASSWORD=<password> --restart on-failure -d ubuntu/mysql

You can access the MySQL server at localhost:30306

<aside> 🙂 YOU ARE SUPPOSED TO REPLACE THE PART WRITTEN IN ANGULAR BRACKETS. FOR EXAMPLE: Replace <password> with the password you want.

</aside>

Step 4

Now you can use the mysql client with the MySQL Server container.

docker exec -it <container_name> mysql -uroot -p