Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Connecting to MySQL from PHP scripts.' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Connecting to MySQL from PHP scripts.
Authored by: Landau on Jul 22, '11 05:32:04AM
Upgrading to Lion makes it necessary to start MySql through launchd. One thing not mentioned in this article is that if you plan to access your databases from php scripts you probably want to create a php.ini file in /etc and reassign the mysql default socket To find the location of the socket file, open a command shell and type
netstat -ln | grep mysql
Create the php.ini file
sudo cp /etc/php.ini.default /etc/php.ini
Edit the file and change pdo_mysql.default_socket and mysql.default_socket to point to the location of the socket file.

[ Reply to This | # ]