Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
MAMP, Headdress, Textpattern, and mySQL not working together.
I am trying to get a local copy of textpattern working on my work computer (OSX). Which is connected to a corporate network (not sure if this is relevant). Here is my setup:
I’m using MAMP to run apache on localhost:8888 and mysql on localhost:8889. And yes, my firewall is turned off.
Now using Headdress I am creating a new site on localhost:9009 so that I can use root relative URL’s and also access the site for testing over the network using my IP address.
Now, side stepping textpattern I have determined that the following code (a PHP/mySQL database connection) will run on localhost:8888 but not on localhost:9009.
<?php
mysql_connect(“localhost”, “root”, “root”) or die(mysql_error());
echo “Connected to MySQL<br />”;
mysql_select_db(“jsbits”) or die(mysql_error());
echo “Connected to Database”;
?>
Can anyone tell me how to get the mysql function to work correctly on localhost:9009. When attempting a connection I get the following error:
Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2)
Should the host value for the connection be something other than localhost?
thanks, cody
codylindley.com
Offline
Re: MAMP, Headdress, Textpattern, and mySQL not working together.
In case anyone wonders using this (127.0.0.1:8889) for the host value returns this error.
Lost connection to MySQL server during query
codylindley.com
Offline
#3 2007-06-02 10:22:38
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: MAMP, Headdress, Textpattern, and mySQL not working together.
127.0.0.1:8889 should work. You could try entering a socket path instead (e.g: /Applications/MAMP/tmp/mysql/mysql.sock).
PHP Manual: mysql_connect
Offline
Re: MAMP, Headdress, Textpattern, and mySQL not working together.
Cody,
I’ve had some difficulty achieving a similar thing for testing localhost using Parallels.
I’ll be following closely :)
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
Re: MAMP, Headdress, Textpattern, and mySQL not working together.
Mary, thanks! I’m not sure why it took me so long to try the UNIX socket. I feel pretty stupid. But it worked.
Instead of localhost, I used :/Applications/MAMP/tmp/mysql/mysql.sock and it worked great. Just so you know, the 127.0.0.1:8889 still didn’t work. It continued to give me the following error.
Lost connection to MySQL server during query
I wish I could figure out why this is not working.
codylindley.com
Offline