← Other topics

Run phpMyAdmin on a Mac (Herd / DBngin)

Video Notes

In this guide I’ll show how to run phpMyAdmin on a Mac. This guide assumes you already have a Apache or Nginx web server running locally, as well as a MySQL database server.

In my example, I’m running Nginx via Herd and MySQL via DBngin, but the following instructions should be adaptable for other setups as well.

phpMyAdmin running on a Mac

Download

Download phpMyAdmin from phpmyadmin.net.

Unzip the download, rename the folder phpmyadmin and move it to your local server’s document root. Then configure your local server so you can load this folder as a site in your browser.

For example, my local server is powered by Herd so I will move the phpmyadmin folder into my ~/Herd directory. Herd will then automatically detect this folder and configure a URL for it, so I will be able to access in the browser via http://phpmyadmin.test.

If you’re not using a platform like Herd, you may have to take additional steps to configure a URL for phpmyadmin by editing things like your server’s virtual host configs and your computer’s hosts file.

Configure

There are a couple config changes I had to make to get phpmyadmin to work with my setup.

To make these changes, I created a duplicate of the config.sample.inc.php file in my phpmyadmin directory and named it config.inc.php.

Within config.inc.php I updated $cfg['Servers'][$i]['AllowNoPassword'] to true. This was necessary because my MySQL server (run via DBngin) sets up MySQL with a blank password by default. Without this config, I received this error:

Login without a password is forbidden by configuration (see AllowNoPassword)
Login without a password is forbidden by configuration (see AllowNoPassword)

Next, I had to update $cfg['Servers'][$i]['host'] from "localhost" to "127.0.0.1". Without this config I received this error:

Cannot log in to the MySQL server
mysqli::real_connect(): (HY000/2002): No such file or directory

Login

With the above configs in place, I was able to log into phpMyAdmin using my MySQL server’s default credentials:

  • Username: root
  • Password: blank
If this info helped you out, you can send a tip via PayPal. Thanks for your support!
← Other topics