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

  mysql_connect

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 http://194.111.1.111/~crystalchan/

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 '194.111.1.111' 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.

link|improve this question
feedback

1 Answer

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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