You could also do a backup and restore with mysqldump, but a copy is probably simpler especially since this is only for development. Now copy the old databases to the new: cp -a įinally, start the MAMP Pro instance and confirm whether the databases are present. Some common functionalities will include : Selecting a database and running related commands Importing database Exporting database First step would be to run MAMP and make sure MYSQL server is ON.
#MAMP PRO MYSQL TERMINAL HOW TO#
You should be able to do this by running the following in a shell: cp -a We will be demonstrating on how to use MySQL from terminal of MAC OS which has MAMP installed on it.
Next, make a backup of the MAMP Pro MySQL installation's datadir. This is important because if they are running, you won't be able to make a consistent copy of the data. MAMP Preferences (Command +, ) Reset MAMP Ports (Port 8888 Port 8889 Apache MySQL ). Im executing this command in command line in the directory of the wordpress installation: the command does not issue any errors, and when i check the database. That will tell you where the databases are for each installation. Terminal terminal Spotlight (Command + Space).
Make sure you use your own password, and not pass. Add the following script to your index.php file.
I've never used MAMP or even heard of it until I read this question, but if both MySQL installations are the same base version of MySQL you can probably fix this by copying the databases from one installation's data directory to the other.įirst, run the following in MySQL in each MySQL installation: SHOW GLOBAL VARIABLES LIKE 'datadir' (For purposes of the test script below, a MyPostGresDB should be created) Here is a simple script for connecting to the PostgreSQL MyPostGresDB database.