Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

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.