Lakshya Goyal
Lakshya Goyal

Reputation: 360

Does reinstalling MAMP delete the existing database?

I am new to databases and MySQL. My friend told me to use MAMP to create a localhost for my small scale database and so I did just that.

I am having problems with the port connections with it. It was perfectly fine when I had Windows 7 but when I upgraded to Windows 10, there is an error which says APACHE needs open port 80 which is already being used by another service or application. Please reconfigure APACHE to use free port. I have tried changing the port number in Preferences but the same problem still. I have found that the programs that use port 80 are Chrome and GoogleDriveSync. I have already tried closing both of these apps but still the same problem.

I decided to reinstall MAMP but before I do, I want to know if that will affect the database that I already have? When I run MAMP, the database is opened in PHPmyAdmin. I'm sure if that is separate to MAMP. So if I reinstall MAMP and then try to open my database, will all my data still be there?

Upvotes: 0

Views: 6825

Answers (4)

M-Coder
M-Coder

Reputation: 41

Save the "db" folder to another location on your machine and copy it back in there. When you restart MAMP your tables will be there.

I had to rename the "mysql" folder to "mysql56"

Upvotes: 1

Chris Rathjen
Chris Rathjen

Reputation: 21

No, you will likely get an error XXX_DB.TABLENAME DOESN't exist.

See https://appsolute.zendesk.com/hc/en-us/articles/215198206-How-do-I-do-a-complete-uninstall-and-re-install-of-MAMP-PRO-.

So, just copy the directory /Applications/MAMP/db/mysql56 and then put the new /Applications/MAMP/db in an archive folder with the old database copied. Restart the server and mysql. And you're back in working order.

If anyone knows to move the root directory of the mysql folder LMK! THanks.

And if you move your website directory inside the Mamp folder (APPLICATION FOR OSX), you can back that up too. That's why I keep the directory separate and easy to find in XAMPP/htdocs2 so that I can remember where to find it and then change the directory every time the server has a bug.

Upvotes: 0

Kami Yang
Kami Yang

Reputation: 427

I just read the Documentation of MAMP. It will delete everything! This means even the databases.

Databases which you have created in MySQL are located in default location (C:\MAMP\db\mysql) they need to be backuped before uninstalling if you want to preserve them (because they will be overwritten on next installation).

- source: https://documentation-3.mamp.info/en/documentation/mamp-windows/

Upvotes: 1

jaydeluca
jaydeluca

Reputation: 26

I would assume that you will lose the data. Just back it up before you do it. Go into phpmyadmin, select the database, click on "Export", select the "custom" radio button, and save to a file. Then when you reinstall, create a new database with the same name, and import the data.

Upvotes: 1

Related Questions