![]() ![]() TablePlus provides a native GUI Client for MySQL which can be downloaded from and installed like any other Mac app. To find the name of the socket you need to use, you can type netstat -ln | grep mysql. To find the location of your php.ini file type php -ini in your terminal. The way to do this to modify the fault_socket variable in your php.ini file and then restart php : fault_socket = /tmp/mysql_3306.sock I wanted to continue using sockets to connect to mysql locally without needing specify the socket name in each configuration file. You could use ‘127.0.0.1’ instead since that forces the driver to use TCP. This mysql utility will use the socket specified by this env variable to connect without my having to specify the correct socket everywhere.Īnother effect of not using the default socket is that you cannot use ‘localhost’ as the DB_HOST parameter in your WordPress config file, as specifying ‘localhost’ causes the mysql driver to try to connect through the default unix socket. Since I just use a single instance of mysql, I simply updated the MYSQL_UNIX_PORT environment variable to avoid having to specify the socket each time - echo 'export MYSQL_UNIX_PORT=/tmp/mysql_3306.sock' > ~/.zshenv This is because DBngin can run multiple instances of MySQL and hence does not use the default socket '/tmp/mysql.sock'. Note : In order to use the mysql utility on the command line or in a shell script, you would need to add the mysql bin directory (which would be something like /Users/Shared/DBngin/mysql/8.0.27/bin/ depending on what version of mysql you selected to create the server) to your PATH variable.Īlso you’d need to specify the correct socket name like so : mysql -socket /tmp/mysql_3306.sock. Choose MySQL, its version and create a server with a custom name.Run DBngin and choose to create a new server.Go to DBngin and download the installer.To enable Https, simply run valet secure mysite from the project directory and your site will become available at ĭBngin is a convenient way to install multiple versions of MySQL and other database servers like PostgreSQL and Redis.You can also use the valet link command to serve sites from any directory.Now if you have a folder named say ‘mysite’ inside this folder, it will be available at If you have a single folder where all your sites are, you can navigate to that folder and run valet park.From the terminal run composer global require laravel/valet.It’s very simple to get started with, doesn’t require any sort of virtualization and makes it really simple to secure your site with TLS. Sudo mv composer.phar /usr/local/bin/composer Install Laravel ValetĪfter a bit of research on what to use as a web server, I settled on Laravel Valet. In order to be able to invoke composer from any folder, you’ll need install composer globally which means to put composer.phar in a directory on your path.Follow the instructions at to download and install Composer.Next on we install Composer which is a package manager for PHP packages. For example : brew install If you already have a version of PHP installed and need to switch to another version, you need to first unlink the version you’re running and link the new version. To install a specific version of PHP other than the latest version you need to use the notation.After the installation is done run php -v to verify that the latest version of PHP has been installed (8.1.3 at the time of writing).To install the latest version of PHP open the terminal and run brew install php.Run brew doctor confirm that the installation was successful. ![]() Follow the installation steps and wait for it to complete. In the terminal run the following command: /bin/bash -c "$(curl -fsSL )".Homebrew is a package manager that allows you install tools, utilities and applications easily on your Mac. Type git - version to confirm that git has been installed. In the popup window choose “Install” and wait for the installation to complete.Launch the terminal, type xcode-select -installand press Enter.This is the first thing we need to install as it contains compilers and other tools which are necessary to develop on MacOS. In my day job, I am a Wordpress developer and so I needed to set up my Mac for Wordpress development. So when I decided to get a second dev machine, I thought I’d finally try out a Mac. That wasn’t really an issue for the most part but every now and then I’d have to figure out how to get something working on Windows. Last year I joined Delicious Brains where most developers use a Mac, so naturally setup instructions and such were geared towards macOS. When I quit my corporate IT job and started working independently as a developer, I stuck to Windows because that’s what I was comfortable with. I’ve been a lifelong Windows user, having worked mostly in companies that required you to use Windows. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |