With MySQL 5.6.34 (MAMP 4.1) this warning has been upgraded to an error causing the process to be aborted. However, macOS Sierra and previous versions of OS X by default use the HFS+ file system which is not case sensitive, hence the warning. Setting -lower_case_table_names to 0 configures MySQL to use case sensitive table names. You have forced lower_case_table_names to 0 through a command-line option, even though your file system ‘/Applications/MAMP/db/mysql/’ is case insensitive. With MAMP 3.5, starting MySQL from the Terminal works without issue, but the MySQL error log – /Applications/MAMP/db/mysql/ – contains the following warning: In the version I was using – MAMP 3.5 – the MySQL version is 5.5.42. I’m happy with this setup and I hope you can benefit from this article.Done a little digging and the culprit is the option It’s also more clear where data lives and although Docker needs a cleanup once in a while too, I do not get bloated with many source packages which sleep somewhere on my disk. ![]() In conclusion: Docker helped me save disk space and administration time I would otherwise spend using brew or port. If I would want to switch PHP version, that would only be a matter of changing the docker-compose.yml file and let Docker do the job, instead of needing to build from source using Xcode command line tools and wait for brew or port to finish. In this case that is plain mariadb as you can reference the one container from the other when they’re configured in one compose file.įrom a wp-config.php: /** MySQL hostname */ Be aware that since WordPress is running in the PHP-Apache container, it should use the Docker runtime host for the MariaDB to connect to the database. I use this setup for websites I develop for clients, which are usually WordPress websites. ![]() One could do the same with the configuration file of phpmyadmin: store it in the _docker directory and map it to a path in the container./_docker/ Also, to persist the MariaDB databases, I’ve configured a Docker volume in order to keep my databases after a turn down of the container. version: '3' services: web: image: php74:latest ports: - '80:80' volumes: - /Users/vincentb/Sites/_docker/apache:/etc/apache2/sites-enabled - /Users/vincentb/Sites:/var/depends_on: - mariadb extra_hosts: - 'ax710.test:127.0.0.1' # - 'some-other-host.test:127.0.0.1' networks: - dev-env phpmyadmin: image: phpmyadmin:latest ports: - 8080 :80 environment: - PMA_ARBITRARY=1 - PMA_HOST=mariadb depends_on: - mariadb volumes: - /Users/vincentb/Sites/_docker/php/php.ini:/usr/local/etc/php/php.ini networks: - dev-env mariadb: image: mariadb:latest restart: always environment: MYSQL_ROOT_PASSWORD: 'secret' MYSQL_USER: 'vincentb' MYSQL_PASSWORD: 'secret' MYSQL_DATABASE: 'vincentb' volumes: - mysqldata: /var/lib/mysql ports: - 3306 :3306 networks: - dev-env volumes: mysqldata: Īs you can see I also have a php.ini file outside of the docker to persist PHP-specific configuration. One running Apache with Php74 and one with MariaDB, the real open source alternative to MySQL and one with PhpMyAdmin. With one command the compose file starts up three Docker containers. # before: /Users/vincentb/Sites/ # after: Options FollowSymLinks DocumentRoot "/var/www/html/" ServerName localhost I copied over the Apache configuration file from the former setup and only had to change all directory paths which map to the volumes directive in the Docker configuration. It uses Docker Compose which is basically a Yaml file with all we need. It took me quite some time before I got on the Docker boat □īasically I have a subdirectory in my ~/Sites directory which contains all Docker configuration. Her video, and a couple of results from Google, say the better tutorial blog post on Docker, resulted in the following setup and configuration. She has a great course on YouTube which lasts about 3 hours (2 hours on 1.5 the speed) digging deep into all features of Docker. I thought the learning curve was too steep, but that wasn’t actually true. I had heard about Docker a couple of years ago but I never had used it. I was fed up with dealing with a lot of administration with regard to running MacPorts and Homebrew: clean up, update, upgrade… Besides they took up a lot of disc space and I regularly had to clean up my MacBook in order to retain enough room for other applications. I deleted both and wrote a docker-compose.yml with about 50 SLOC that’s easier to maintain and easy to set up. But I found out both use an aweful lot of diskspace. I had both Macports and Homebrew installed… Why? I can’t recall actually. I was cleaning up my laptop as I had only 6Gb left on my 2013 MacBook Pro. ![]() This article describes a way to set up a MAMP development environment with Docker, Apache, PHP and MariaDB (i.e. MySQL). ![]() It took me quite some time before I got on the Docker boat (pun intended), but since last few weeks, I’m totally in.
0 Comments
Leave a Reply. |