Pros: Easily connects to databases through the TCP/IP protocol. This tool is the successor of the CocoaMySQL database management application. If you take some time to learn how to use the Favorites and such feature, your typical DB tasks are terrifically simplified.What does Activity Monitor show Mines been showing as a 64 bit app since installing it on Leopard, even though the preference pane has it listed as 32.I know, Docker, gross right? Suppress that reaction for a few paragraphs…While other MySQL tools we looked at are available for Windows and other OS, Sequel Pro will only work on Mac OS X. I had been using another client previously, but this solution is soooo much better designed and usable. Great MAC SQL solution While Im not a daily user, this is a terrific solution for managing basic DB needs on a MAC.
Mysql Client Download MySQL ServerForHowever, it looks like macOS Big Sur will not upgrade PHP. I held hope the next version of macOS might adopt a modern version of PHP. It wasn't until installing macOS Catalina that I began to move away from the preinstalled development tools I had preached for so many years.The primary reason was the need for a newer version of PHP. Download MySQL ServerFor the last 8 years I've held one of the top search results for Installing Apache, PHP, and MySQL on Mac OS X. By the end of this tutorial, you will be able to set up the MySQL server on your Mac system for local development purposes.But when it doesn't you're going to burn a day searching the web trying to figure out some obscure error message. And when it works, it works. This post will outline the process for a basic setup using Docker.Before moving on to the actual implementation, let me address the two questions I still receive after all these years.Homebrew is a package manager for macOS. Which 75% of is powered by PHP.For those reasons, I am finally making the switch to using Docker for local development with Apache, MySQL, and PHP on macOS. All of which set the internet ablaze.But it's happened to me enough times over multiple versions and multiple years. And when you upgrade macOS, you'll receive another error and the solutions before no longer work.Yes yes, I know you don't have any problems. But it's only a matter of time until you receive another obscure error and burn another day.![]() These days, I think learning a ubiquitous tool like Docker provides a far better return on my investment than learning how to wrangle a package manager on my local macOS.Yes I know there's MAMP, Valet, and whatever other hotness. You can set up a complete infrastructure which perfectly mimics your production environment running load balances, cache servers, queue workers, and more.So, to address the matter simply - if I'm going to learn something I want to get the most return on my time investment. Once using Docker, you have access to countless images to create all sorts of development environments, running things beyond Apache, MySQL, and PHP. Most notably having a default client for most platforms, including macOS and Windows.The reality is, Docker is a simple client install and then a couple commands from the command line. In addition, Docker has made advancements since I tried over the years. Once you have Docker installed locally, you can run anything you want. That's another benefit of Docker. With Docker I can take my image and provision local development environment, a production environment, a GitHub action, and so much more.With that said, let's move on to getting a local development environment running Apache, PHP, MySQL on your Mac using Docker.Since this is a tutorial for macOS, download the Docker Desktop for Mac.However, if you are using another platform, such as Windows, you may still follow along with this tutorial. This effectively replaces the technologies which were originally installed on macOS by default.In addition, this includes the latest version of Composer (2.0) and Git.All this goes in a Dockerfile. As you become more proficient with Docker you can find (or create) one to better suit your application needs.The one I'm offering web server running PHP and Apache. Yes, I'm taking a few liberties with those terms.There are all sorts of images available. We do this with an image file. You may notice a file system lag when interacting with files or installing things locally. So Docker simulates your actual application environment versus running Apache, PHP, and MySQL locally on macOS would have.What's not nice about this, is the same thing that's not nice about Docker. It ideally has the same paths, operating system, software, and versions your production server has. Then we'll exit the terminal with exit or by pressing Ctrl + D.What's nice is this environment can mirror your production environment. But again since macOS defaults to Bash, that's what I'm using here.Let's throw a few commands at it like php -v to see the PHP version and composer -V to see the Composer version. It allows us to run an interactive terminal within the container instance we specified using the Bash shell.Of course, you could build an image with whatever shell you like. So I've learned to live with it. Especially npm install as that may require system level components which are easier to install locally than on the container.Fortunately such operations are not that common. Or even worse, npm install.For those reasons, whenever possible I may still run these commands locally. Similar to our local install before we need to direct web traffic to our Docker web server.Similar to configuring Apache virtual hosts on macOS, I do this by editing my hosts file. Directing web trafficEven though everything's running, our server is likely not directing web traffic to the appropriate location. And based on its output, we may use the container ID to interact with either of the containers in the stack by passing it to docker exec. But you can call it whatever you want.To see both containers running, we may run the docker container ps command from earlier. In this case, I simply named it dev. Wip isn't my first choice, so many extensions exist now. Dev, but Google took it.While. This sometimes conflicted with Bonjour and local macOS networking. Wip extension, rather than a. ClosingI start with this tutorial because I believe it's an easy way to get started with Docker. I resolved this by disabling "Use gRPC FUSE for file sharing" within the Preferences of the Docker Desktop Client. Again, you're welcome to choose any available extension you like.After upgrading to Docker 2.4 I experienced intermittent file sync issues. Interact with Docker containers with the dec command Once you do, you should have enough of a foundation to do even more.You may also review the following articles below which include some additional services and minor tweaks to make your local Docker development environment even better. But it's a start as you get familiar with using Docker.I encourage you to get familiar with the different commands. Make jframe for macBuilt with Jigsaw and Tailwind CSS. Without their help, this tutorial would not exist.Find this interesting? Let's continue the conversation on Twitter.Written by Jason McCreary.
0 Comments
Leave a Reply. |
AuthorTroy ArchivesCategories |