The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   Tiger: php & mysql (http://hintsforums.macworld.com/showthread.php?t=39250)

sailgreg 06-04-2005 06:27 PM

I made a LaunchDaemon file for MySQL which works as a replacement for the StartupItem on Tiger. Save it as com.mysql.database.plist in /Library/LaunchDaemons and run 'sudo launchctl load /Library/LaunchDaemons/com.mysql.database.plist' or reboot to load MySQL.

PHP Code:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict> 
   <key>Label</key> 
   <string>com.mysql.database</string> 
   <key>OnDemand</key> 
   <false/> 
   <key>ProgramArguments</key> 
   <array> 
      <string>/usr/local/mysql/bin/mysqld_safe</string> 
   </array> 
</dict> 
</plist>

I use MySQL 4.1 from the official site, you can change the path to make it load a version compiled with DarwinPorts or Fink.

vancenase 06-04-2005 06:44 PM

i just found this gem on the main site: http://www.macosxhints.com/article.p...31212142956308

Code:

daemonic install MySQL
now a fink installed mysql automatically starts on boot!

sailgreg 06-04-2005 07:20 PM

Quote:

Originally Posted by vancenase
i just found this gem on the main site: http://www.macosxhints.com/article.p...31212142956308

Code:

daemonic install MySQL
now a fink installed mysql automatically starts on boot!

The code I posted in the post above yours is a better way of doing it. Just change /usr to /sw to use the the version of mysql compiled with fink. StartupItems are being phased out and being replaced with LaunchDaemons.

smeshy123 07-05-2005 05:35 PM

Sorry for bringing up this old thread, I know its been dead for about a month. But I've done absolutely everything on this thread! (which has been the most informative one out there) and I cannot get PHPMyAdmin to work for anything. I get that error message:

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

And I'm soo confused. I'm not even sure if MYSQL works properly. I have like 2 versions installed the one under usr and the one under the other directory that is installed with fink. I have no clue how to get anything to work. I also get this error on my actual web page as opposed to just PHPMyAdmin:

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)

Any help would be much appreciated.

Thanks a bunch!

Smesh

bhedana 09-19-2007 03:56 PM

if you CAN connect to mysql via terminal but not from phpmyadmin then chances are php can't locate your mysql.sock file...

set the path to the socket in your php.ini file and restart apache and you should be golden

J_T 09-20-2007 08:31 PM

first things first make sure the fink installed mysql is running try using this command

ps -aux | grep mysqld

see if it returns an instance of mysqld running out of the fink folder ../sw/ I beleive. If the correct one is running then, like bhedana says, make sure your php.ini is set to look for the mysql socket. It shoud look something like this.

mysql.default_socket =/tmp/mysql.sock

acme.mail.order 09-21-2007 06:13 AM

bhedana and J_T:

The first thing both of you should do is check the post dates - this one seems to be finished back in 2005, and they've probably either solved it or given up by now :rolleyes:


All times are GMT -5. The time now is 06:22 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.