Wednesday, October 12, 2011

Mac - MySQL - CodeIgniter - Issue (Solved)

My CodeIgnited just stopped working with New MySQL server installed on Macbook, Osx 10.5.


following blog post+some my own tricks, saved my lots of effort to make it work.


Mysql & php configs were missing from system, earlier my system used to work with MAMP.


I copied my-huge.cnf (as my m/c has more than 1G ram) to /etc/my.cnf from /usr/local/mysql/support-files/


I copied existing /etc/php.ini.default to /etc/php.ini and did following changes.




http://drupal.org/node/46300


The version of PHP that Apple included with Mac OS X 10.4.4 has mysql.default_socket set to "/var/mysql/mysql.sock", before it was "/tmp/mysql.sock". They change it for some security reasons I believe.
The binary version of MySQL from mysql.com use "/tmp/mysql.sock" so one has to change.
I choose to make PHP look for "/tmp/mysql.sock" by setting this in /etc/php.ini.
; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket = /tmp/mysql.sock
I also tried to go the other way by setting this in /etc/my.cnf.
#Name of the socket file to use.
socket=/var/mysql/mysql.sock



No comments: