Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to connect to mysql using the personal webpage on Mac OSX. However, I keep having issues when i do the command...


It says my computer name is spiderman, and that local networks can access it at spiderman.local

My ip address is along the lines of

I have PHP, MySQL, and Apache enabled on my Mac. When I try the sql command from a php file, it keeps saying

Could not connect. Host '' is not allowed to connect to this MySQL server

For the arguments for the mysql_connect function, I've tried using my ip address, spiderman.local and none of them work. Any help would greatly be appreciated.

The error comes from my line of code

mysql_connect($this->host,$this->username,$this->password) or die("Could not connect. " . mysql_error());

There is no set username or password created so I don't think they matter.

share|improve this question

Some mysql installation accept by default only connections from '' or 'localhost'.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.