How to add PHPMyAdmin to Local by Flywheel

I really like Local by Flywheel as my go-to PHP development environment (Especially, WordPress). But, the default MySQL content management system (Adminer ↱) is not my favorite 😐. I wanted to use PHPMyAdmin ↱ with Local by Flywheel ↱ just like you 😄 for some reason. I would like to know why do you need to switch from Adminer to PHPMyAdmin.

Advertisement
Udemy 100% FREE COUPON CODES

There are few methods to use PHPMyAdmin with Local. I found that this method is the easiest and beginner-friendly method without editing a bunch of Local files. To add PHPMyAdmin to Local follow these really simple steps. It is same as creating a new WordPress instance using Local.

1. Setup a new site on Local

Setup a new website using Local by Flywheel options and call it however you want. (phpmyadmin.tld would be great). Then, select your environment and setup your WordPress website.

2. Download and Install PHPMyAdmin

First of all, you should clear the public folder of the recently created website. Yes, remove everything in the public folder. Then, head over to phpmyadmin.net ↱ and download latest PHPMyAdmin archive. Now, extract the downloaded file into your public folder. Simple stuff 🙂

Almost done! Check your configured domain (phpmyadmin.tld) and you should see the PHPMyAdmin login screen. You can use the database username and password to login to your database. but, wait! this is not the database you wanted to open. Right? Yes, by default PHPMyAdmin accessing the database of its own virtual server. This is not an issue with PHPMyAdmin. This is how Local by Flywheel works. It literally opens/reserves a new port for each website/database you create. The simplest solution that came into my mind is adding the server select box to the PHPMyAdmin login screen. So, I can easily select between different ports (or you can say servers).

Advertisement

3. Configure PHPMyAdmin to Select Specific Ports

Go back to your public folder of the PHPMyAdmin installation. Find the file called config.inc.php. If you don’t find the exact file, just rename the config.sample.inc.php to config.inc.php.

Open your Local by Flywheel dashboard and find select the website that you need to connect with PHPMyAdmin. Then, select the Database tab and there you will see the reserved port number for the MySQL database.

Now, open config.inc.php from your favorite code editor and just underneath the first server configuration, add the following code. Make sure to replace your port number which you found on the previous step and preferred name (verbose).

/**
* Second server
*/
$i++;
$cfg['Servers'][$i]['verbose'] = 'Dev 1';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '10004';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

add PHPMyAdmin to Local by Flywheel

4. Done

That’s it! You can repeat step 3 to add more servers. Kind of a silly solution but it works. Let me know if you have any questions.

5 1 vote
Article Rating
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Devesh Fotinatosstein
Devesh Fotinatosstein
1 month ago

hello

2
0
Would love your thoughts, please comment.x
()
x