This article will show step by step on how to setup phpMyAdmin with Laravel Valet:
-
Install Homebrew. Execute the following shell command in your terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
If you have Homebrew already installed, update it:
brew update
-
Install composer. Execute the following shell commands in your terminal:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');"
Reference: Composer Command-line installation
-
Move/rename the executable composer script to
/usr/local/bin/
so that we can execute it anywhere and as plain "composer" (without the .phar):mv ~/composer.phar /usr/local/bin/composer
-
Now lets install Laravel Valet using composer:
composer global require laravel/valet valet install
-
Install phpMyAdmin using Homebrew. Execute the following shell command in your terminal:
brew install phpmyadmin
-
Register phpMyAdmin path with Laravel Valet. Execute the following shell commands in your terminal:
cd /usr/local/share/phpmyadmin valet domain test valet link
Now you can access phpMyAdmin in your favorite browser via http://phpmyadmin.test.
Comments
Easy as pie
Already had Homebrew, Composer, as well as Valet installed. So to me it was just a matter of following step 5 and 6. Of course, depending on everyone's existing setup, YMMV :)
But thanks so much for sharing this one!
PS: Just a small note: for a fresh Valet installation, the valet domain test
command is optional. Out of the box, Valet already proxies all requests to *.test
pseudo TLD by using DnsMasq. See the official Valet Docs.
404 not found
Hi
This seemed very easy... I did 5 & 6 in Terminal (I had everything else installed b4) but when I try to type http://phpmyadmin.test in the browser, I get 404. Any idea?
Paul
Restart
Hi, please try to restart the web server.
Nice, thanks!
Thanks!
Valet has had an update since
The new command to change the tld is valet tld test
not valet domain test
Still a great post, I still revisit every time I need to install phpmyadmin for valet!
Update for Big Sur / Homebrew 3
Really helpful post, thanks.
I'm running Big Sur (11.6) on an M1 Mac, with Homebrew 3.2.15. Some paths are slightly different:
cd /opt/homebrew/share/phpmyadmin
valet tld test
valet link
...then I'm running the Brew mysql package, which defaults to local-only root access without a password. To enable that in phpmyadmin, edit (in the directory above) config.inc.php
and change:
$cfg['Servers'][$i]['AllowNoPassword'] = true;
(line 32, as I write). I can now access phpmyadmin.test in my browsers.
about the login
Thanks.
Now, I am on this page: http://phpmyadmin.test/
but what are the username and password? I used root and root as username and password but not working.
Default username password
The default database username: root and the password is empty.
cant acces usr/local/share/phpmyadmin
i can acces usr in terminal, i can acces local in terminal, but share isn't found, i can acces share after usr, but there is no phpmyadmin on there
Works
Update for Big Sur comment also worked for my M1 Sonoma fresh install
Great post! Worked for me :)
Great post! Worked for me :)