How to increase the memory limit of imported SQL files in PHPMyAdmin with MAMP

In MAMP

File > Edit Template > PHP 5.5.3 PHP.ini

In my case this was the version running, so it was the one I had to modify. MAMP let’s you choose among different versions, so take this into account when you modify it.

When you load the PHP.ini in the phpInfo tab of the home you will also see where the PHP.ini file is located

/Applications/MAMP/bin/php/php5.5.3/conf

Read the info on this link for further details: http://blog-en.mamp.info/2009/09/increase-php-memory-limit-with-mamp-pro.html

MAMP: how to use MYSQL from console

I could not access the mysql database from console, getting this error

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ 

So I googled and found this:

http://fischerlaender.de/apple-mac/mac-os-x-trouble-with-mamp-mysql

and I sorted it out using:

sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock

This will allow you to access through the console and do things such as

mysql -u root …

But now, there is an additional challenge. When I try to use the database through php (launching the console php -a), using sentences to connect such as mysql_connect(DB_HOST, DB_USUARIO, DB_PASSWORD) it will return the error

Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in php shell code on line 1

So, again searching in google, this is the solution: http://stackoverflow.com/questions/4219970/warning-mysql-connect-2002-no-such-file-or-directory-trying-to-connect-vi

sudo mkdir mysql

cd mysql/

sudo ln -s /tmp/mysql.sock mysql.sock

 

 

Enabling Apache logs in MAMP Pro

MAMP Pro uses a template to configure the apache configuration file. So you have to open MAMP  Pro and open templates apache, as described here

http://documentation.mamp.info/en/mamp-pro/advanced-functions/edit-configuration-files

Then change the lines as explained here

http://documentation.mamp.info/en/mamp/faq/where-can-i-find-the-logs/how-can-i-enable-the-apache-access-logs

and restart apache!

You will now be able to see the logs in real time using
tail -f /Applications/MAMP/logs/apache_access.log