Still have MySQL problems that need to get solved soon (was: Re: Apache and MySQL won't start)

Ryan Schmidt ryandesign at macports.org
Wed Jul 28 23:49:40 PDT 2010


On Jul 28, 2010, at 22:53, Ali A Samii wrote:

> Yes, I finally was able to get MySQL to run.
> 
> I queried to see what mysql processes were running, and I got the following line:
> 
> alis-imac:tmp ali$ ps auxw | grep mysql
> root      2022   0.0  0.0  2445728    572   ??  Ss    7:04PM   0:00.14 /opt/local/bin/daemondo --label=mysql5 --start-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper start ; --stop-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper stop ; --restart-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper restart ; --pid=none

FYI, daemondo is the wrapper process MacPorts starts in order to start daemons. Any time you "sudo port load" a port, MacPorts will start daemondo, which will start whatever daemon that port has.


> So, I issued a alis-imac:tmp ali$ sudo kill -9 2022 to kill that process.

FYI, since daemondo was most likely started by launchd (either manually via "sudo launchctl load" or "sudo port load" or at system start time), and one of the purposes of launchd is to restart processes that crash, killing daemondo will just cause daemondo to be launched again immediately. If you ever really want to kill a process that was started by launchd, and you don't want it to respawn, unload its launchd plist first.


> I then rechecked for mysql processes, and I had the following:
> alis-imac:tmp ali$ ps auxw | grep mysql
> _mysql   31710   0.1  0.6  2508960  19860   ??  S     4:51AM   0:00.10 /opt/local/libexec/mysqld --basedir=/opt/local --datadir=/opt/local/var/db/mysql5 --user=_mysql --log-error=/opt/local/var/db/mysql5/Alis-iMac.local.err --pid-file=/opt/local/var/db/mysql5/Alis-iMac.local.pid
> ali      31715   0.0  0.0  2435084    564 s000  S+    4:51AM   0:00.00 grep mysql
> root     31660   0.0  0.0  2435468    780   ??  S     4:51AM   0:00.02 /bin/sh /opt/local/lib/mysql5/bin/mysqld_safe --datadir=/opt/local/var/db/mysql5 --pid-file=/opt/local/var/db/mysql5/Alis-iMac.local.pid
> root     31650   0.0  0.0  2447276   1040   ??  Ss    4:51AM   0:00.01 /opt/local/bin/daemondo --label=mysql5 --start-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper start ; --stop-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper stop ; --restart-cmd /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper restart ; --pid=none
> 
> I was the able to set the root user password.
> 
> I then installed the following
> 
> 	sudo port install php5-mysql
> 	sudo port install phpmyadmin
> 
> They seemed to install without any problems. So I edited httpd.conf and added or uncommented the following lines:
> 
> 	LoadModule php5_module modules/libphp5.so
> 	LoadModule fastcgi_module modules/mod_fastcgi.so
> 	AddType application/x-httpd-php .php
> 	AddType application/x-httpd-php-source .phps
> 	Include conf/extra/httpd-userdir.conf
> 
> I also set the following to change the web directory/root
> 	DocumentRoot "/Library/WebServer/Documents"
> 	<Directory "/Library/WebServer/Documents">
> 
> I added index.php under DirectoryIndex as such:
> 	<IfModule dir_module>
> 		DirectoryIndex index.html index.php
> 	</IfModule>
> 
> I then created a phpinfo.php file and added it to my root web directory. I stopped and restarted Apache and mysql.
> 
> Apache works, I can get to my web root.
> 
> But php doesn't work. When I load phpinfo.php, I get the ext echoed back to me.

I assume you meant that you see the PHP code, instead of it being executed by the server? As far as I can tell, the lines above are all you should need to add to get PHP to work. You can check our MAMP how-to document and see if you've done all those steps:

http://trac.macports.org/wiki/howto/MAMP

> Also, when I try and load phpmyadmin by browsing to http://localhost/phpmyadmin/ I get the following error:
> 
> The requested URL /phpmyadmin was not found on this server.

That's logical. If that's how you want phpmyadmin to work, you'd need to add a line like the following to your httpd.conf:

Alias /phpmyadmin /opt/local/www/phpmyadmin




More information about the macports-users mailing list