Ready to watch this entire course?
Become a member and get unlimited access to the entire skills library of over 4,900 courses, including more Developer and personalized recommendations.Start Your Free Trial Now
- View Offline
- What is MAMP?
- Downloading MAMP and WordPress
- Installing MAMP and WordPress
- Accessing WordPress from your desktop
- Troubleshooting your setup
Skill Level Beginner
There are many reasons why you may want to uninstall MAMP. It could be because it's not working or because you're not using it or any myriad of other reasons. If you plan on uninstalling MAMP but you want to keep the option open to use WordPress under MAMP again sometime in the future without having to reconfigure and repopulate the site, following the following procedure will help you do that without a lot of extra work. If you remember from when we installed MAMP and made a work with WordPress, we've installed MAMP as an application and then we placed WordPress in a folder on our computer.
That means when we uninstall MAMP, WordPress still stays on the computer. However, all the information you put into WordPress--say you created posts or pages-- are stored in the database that's contained within MAMP. So before you uninstall MAMP, you need to export the content from that database, so you don't have to make it all over again. Exporting the database is done from the MAMP web interface. You can access the MAMP web interface by going to start page in MAMP.
And if you don't already go directly to the web interface, simply go /MAMP, all caps. And this takes you to the MAMP web interface. From here we're going to go to phpMyAdmin and then we're going to select our database. So you go to left-hand side here and find your database. Mine is called mywp. Then you select Export from the tabs. Here, I'm going to use the Custom export method.
I'll scroll down and make sure that the output is saved as a file. That way I can store it on my computer and use it later. I'm going to scroll further down and check this box here that says Add DROP TABLE and then I'll scroll all the way to the bottom and click the Go button. This creates a SQL file. You can see it here, and I can open it in my Finder. This SQL file is a complete dump of the entire database.
So later if I want to create a new database, I can simply import that entire file into the database and all my original content will reappear. Now I want to save this file somewhere so that I can easily bring it back if I need to. To do that, I'm going to go to where I placed WordPress itself. It's under Documents/Sites/WordPress, and then I'm going to place it inside the wp-content folder. I placed it into the wp-content folder, because if I were ever to upgrade WordPress or if I was to install a new version of WordPress, the wp-config file and the wp-content folder are the only two elements I wouldn't delete and then reinstall.
The wp-content folder contains all of my custom themes and plug-ins and also any uploaded files, and in this case, I'm also going to add my database backup to it. So I will create a new folder, call it Dbbackup. Then I will simply drag the SQL file. So we exported database file into this folder. Now I know that I can uninstall MAMP without losing any of my content. So I will go to MAMP and turn it off.
Now because I'm on a Mac to uninstall MAMP all I have to do is find it. Here it is MAMP and MAMP PRO. Then I'll go to the Options menu and move it to Trash. Now MAMP is uninstalled, and if I try to access it from my browser, you'll see I get nowhere. Let's say I now cleared my trash bin, so I couldn't resurrect MAMP from memory. Now MAMP is uninstalled from my computer, and I can still access my WordPress files, but I can't run WordPress.
So what if I wanted to reinstall MAMP and make everything work the way it did before? To do that, I first have to reinstall MAMP itself. So I will go back to my Finder, go to my Downloads, or I could download MAMP again from the web. I'll run the package file. Run the install. I'll open MAMP. Change my Preferences.
So I will point the Apache route to where our WordPress is located. It's right here under Documents and Sites. I will make sure my other settings are where I want them to be. Click OK and click Open start page. But now we get this error message, Error establishing a database connection, because we installed MAMP from scratch. So we need to create a database for MAMP to use.
But because we've already made a backup of our existing database, we can use that one instead. So I'll go to the MAMP web interface, /MAMP. Go to phpMyAdmin. Go to Databases. Create a database with the same name that you used before. In this case it was mywp. Then I can go to that database over here on the left.
Select Import, choose the file, and that follows under Documents/Sites/wordpress/wp-content/wp/Dbbackup. I'll click Open and click Go. Now our database is imported, and if everything worked right, I should now see my WordPress site up and running again.
Here you see that post I've created earlier, and you see that all my configurations are now in place. By following the correct procedure and exporting your database before uninstalling MAMP, you ensure that if you ever want to reinstall MAMP and keep using your original content later, you can do so without losing anything in the future. Now you know how to install, set up, and use WordPress on your Mac using MAMP. All that's left to say is go forth and code.