问题
- I installed Yosemite
- Renamed MAMP to MAMP_old
- Did a clean install of MAMP
- Copied the db folder from old into the the new one
Now none of my databases appear in PHPMyAdmin
Inside the db/mysql
folder I see the folder for my old databases, but there are no sql files. For example a Wordpress folder contains .frm
files and db.opt
files.
I tried doing this (using the link below), but I don't seem to have a mysql folder usr/local/
/usr/local/mysql/bin/mysqldump -u root -p[pass] [db] > [filename].sql
Can't access MySQL databases after upgrade to Mountain Lion (using MAMP)
What should I do to restore my old databases? I have very limited knowledge in this area.
Many thanks
回答1:
I ran into this problem with upgrading to MAMP PRO 5 from 4. The following article proved invaluable: https://appsolute.zendesk.com/hc/en-us/articles/215198946-I-upgraded-to-MAMP-PRO-5-and-I-am-missing-databases-
To quote:
Your old MySQL 5.6 data is in
/Library/application support/appsolute/MAMP PRO/db/mysql56_2018_xxxx
To be on the safe side, first make backups of your host data, and your entire /Library/application support/appsolute/MAMP PRO/db/
To verify this is your old data, look inside of this mysql56_2018_xxx folder, you should see subdirectories of all of your old databases in this folder.
If you see missing databases in MAMP PRO 5, you can "reupgrade" your old data by doing the following.
- Quit MAMP PRO
- Rename your mysql57 folder to mysql57_back
- Make a copy of your mysql56_2018_xxxx folder, name it mysql57.
- Start MAMP PRO, start your servers
- Run Tools > Upgrade MySQL DB
Notes:
Instructions available online for MAMP (not MAMP PRO) may be misleading.
The above refers not to the /Library inside the package contents of the MAMP PRO app, but /Library from the root of your drive.
In my case the complete original databases were in the folder simply named
mysql56
. There were additional incomplete date-stamped folders suggestive of failures during the original DB update process.
回答2:
Here is a link to an article which I think can help anyone in a similar situation:
How to Upgrade MAMP
So the basic idea is that you will need to copy your db files from the old MAMP folder to the new MAMP folder.
Another technique you could use would be do a mysqldump before upgrading, then import that dump file into the new version of MAMP.
来源:https://stackoverflow.com/questions/27210289/cannot-find-old-mysql-databases-after-upgrading-mamp