MAMP / MAMP Pro database conflicts - mysql

I sometimes get the databases in phpMyAdmin that are stored under /Library/Application Support/appsolute/db/mysql, this should be the path for MAMP PRO. However, I don't use MAMP PRO. I have tried the trial once, and continued using the free version.
However, sometimes I get the databases visible under /Applications/MAMP/db/mysql, they are a bit off, and I am missing a database there I was working on the other day, but the database is visible in the MAMP Pro database.
I have tried copying the database to the MAMP free database folder, but this results in giving errors in phpMyAdmin. It does show the tables in the database, but it cant display the structure of the tables.
Update:
Still experiencing this issue. Right now I just started my Mac and started MAMP, wanted to continue working on a project and it loads the other database (I think this is the database stored in MAMP Pro), when yesterday it was loading the MAMP databases.
I have no idea how and why this is happening, and how I can find the issue.
Long story short: MAMP uses the MAMP Pro databases sometimes in /Library/Application Support/appsolute/MAMP PRO/db/mysql instead of /Applications/MAMP/db/mysql/, note that I don't have MAMP Pro, I have the regular MAMP. Sometimes it uses the MAMP database folder, sometimes it uses the MAMP Pro databases folder.

MAMP is using this mysql database:
/Applications/MAMP/db/mysql
MAMP PRO is using this databse:
/Library/Application Support/appsolute/MAMP PRO/db/mysql
this may help I'm not too sure - your databases should be in either one

This sounds like a path related issue.
Check your system paths and fix any errors that are pointing to MAMP Pro.
Also, check your MAMP conf file and see how the datadir is set, is it set to the MAMP Pro location ?
SHOW GLOBAL VARIABLES LIKE 'datadir';
datadir - /Library/Application Support/appsolute/MAMP PRO/db/mysql/
An example of a custom conf file used to change this
default-storage-engine=MyISAM
innodb=OFF
datadir=/Users/someuser/drive/mysql/
Let me know in the comments if this helps and we can work out the error as we go along, I'll edit the answer accordingly if need be.

Related

mysql workbench dropped table

my MySQL workbench setup with a database on it. I was using xampp with it but xampp stopped working so I uninstalled and reinstalled it. could this be the issue as to why the table went missing?
workbench is only a Gui, it will not drop anything without any user input.
MySQL server and xammp would work parallel when you choose a different port for one of them.
Your problem is that both save theier files in diffrent path(default)
MYSQL saves its data in
C:\ProgramData\MySQL\MySQL Server 8.0\Data
While xammp stores their database in
C:/xampp/mysql/data
in Restoring MySQL database from physical files you find a tutprial how to restore your tables from the files from your old installation

MAMP 4.1.0 on Win 10 not starting MySQL

I've installed MAMP 4.1.0 on Win 10 Home on my HP laptop (AMD Ryzen 5 processor / 8G Ram / 1TB HDD) and am having issues keeping MySQL (V.5.7.24) running. It defaults to ports 80 for Apache and 3306 for MySQL. Apache starts and runs fine. MySQL only starts upon first initial installation and it works perfectly at that point. I can access via phpMyAdmin with no problems. But if I shut the servers down and attempt to restart, only Apache starts, MySQL does not. I've tried rebooting, but MySQL will NOT restart. I've checked the MySQL error log, but nothing appears to show anything associated with the problem. If I try to use phpMyAdmin while MySQL is shown as not up in MAMP I get the error messages shown in the attached file phpMyAdmin Errors. If anyone has any ideas on what the problem might be and what I can do to resolve this, please respond. I appreciate any help.
I had the same problem. Contacted mamp support. Their answer was the following. It worked for me. Hope this helps you too.
Stop all servers in MAMP.
For MAMP:
With Windows Explorer go to folder C:\MAMP\db\mysql\ (if C:\MAMP\ is your installation directory).
First backup all files that begin with mysql-bin.*
Then delete all files that begin with mysql-bin.* (including mysql-bin.index file.)
Then try starting all MAMP servers again (wait for MySQL to turn light on).
After that stop all MAMP servers again.
You'll now try to disable binary log-bin in MAMP (or MAMP PRO)
For MAMP:
Open up MySQL configuration file in text editor of your choice:
C:\MAMP\conf\mysql\my.ini
This example assumes C:\MAMP\ is your installation directory.
Find following text:
log-bin
Comment this line by adding # character at start of line.
#log-bin=mysql-bin
Save and restart servers
After that put the mysql-bin.* files back in their place.
Try the following. It fixed my issue.
Stop your MAMP Server.
Find the db folder for mysql. In my case: C:\MAMP\db\mysql
Rename the mysql-bin.index file to mysql-bin_old.index
Start your MAMP Server

Linking MAMP on Mac to a different instance of MySQL and phpMyAdmin

I am using macOS Sierra 10.12.2, MAMP 3.0.7.3.
I have been using MAMP with the MySQL it comes with for a while but I need to run something (Magento 2) that requires a higher version of MySQL than the version MAMP comes with, and I don't want to upgrade that instance of MySQL that comes with MAMP. So I am trying to install a different instance of MySQL for use on this project. I still want to use MAMP's Apache server with PHP to run the project though. I also still want to be able to switch back to the other instance of MySQL.
I am essentially trying to follow this tutorial, but I also want to install phpMyAdmin: http://www.human-element.com/installing-magento2-on-mac-for-local-development/
I have installed MySQL 5.6.35 to /usr/local/mysql/bin
The MAMP MySQL is at /Applications/MAMP/Library/bin/mysql
/Applications/MAMP/Library/bin/mysql --version is 5.5.38
mysql --version is 5.6.35
It seems to be installed correctly but I want to use phpMyAdmin for it, which is where I am having trouble. I downloaded phpMyAdmin 4.6.6 and installed it to /Applications/MAMP/htdocs/phpMyAdmin-4.6.6 (as I still need MAMP to run it). But it seems to be linking with the MAMP instance of MySQL and not the new instance of MySQL. I can only log in with credentials for the MAMP MySQL users and I see all my MAMP databases.
If I go to localhost/phpMyAdmin-4.6.6/setup I think the setup must be wrong but I'm not sure how to specify the other MySQL instance:
I tried changing the server socket path to /tmp/mysql.sock too - this had no noticeable effect.
I also have some symbolic links set up, although I admit I don't really understand what this is for...
cd /var/mysql/
# This one was set up before when I was just using MAMP:
mysql.sock -> /Applications/MAMP/tmp/mysql/mysql.sock
# This is the equivalent I set up (removing above one) for the new instance, but not sure if correct:
mysql.sock -> /tmp/mysql.sock
I've tried switching between both but it doesn't seem to have any effect on phpMyAdmin.
Can someone explain how I link the new version of phpMyAdmin with the new instance of MySQL?
Since you're essentially trying to run two MySQL instances at the same time, you have to make sure they're not using the same socket and TCP/IP port. These things are configured in the MySQL configuration file. I suggest not messing with the MAMP installed version, so edit the one you installed and make sure the port and socket path are different. Also make sure your data directory is different; you can't use the same datadir for two MySQL instances at the same time, and certainly not changing between versions, either. Once you have that sorted out, you can configure phpMyAdmin to connect to them both (you can define more than one server, based on port, hostname, and/or socket).

Cannot find old MySQL databases after upgrading MAMP

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
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.
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.

Mac OS X mySQL custom database path (MAMP PRO)

I'm using MAMP (OS-X 10.6.6) and I want to move my mySQL db folder to my dropbox folder.
The MySQL server MAMP runs stores its databases in
/Library/Application Support/appsolute/MAMP PRO/db/mysql
..and I can't get it to follow symlinks or aliases to the mysql folder.
Is there a way to change the path mySQL uses for storing its databases? On the MAMP forum they say it's not possible, but I imagine there must be some kind of config file for whatever mySQL server it is that MAMP is running that can be changed to specify an alternative location for the used DBs..?
Anyone know how to acheive this? Storing the DB's on dropbox is the last element I need to solve to be able to work on my projects from my different computers.
Just realized that its just the finder 'alias' type that won't work. creating a proper unix symlink works fine. so doing this solves the problem and keeps the databases on dropbox.
ln -s /Users/username/Dropbox/MAMP_db/mysql /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql
mwb's method works. Remember, you also need to be be running Apache/MySQL server as user. Those settings are in MAMP PRO (Server -> General)
If you are going to be using dropbox to access the database on another machine, you will need to have identical paths to Dropbox as well.