动态数据PHP错误[重复]

I'm a inexperienced webmaster for my Boy Scout troop. I have recently set up MAMP on my map and then tried to use MySQL PHP server for dynamic data. When testing locally, everything worked. When I uploaded everything to my web server (for which I only have FTP access) I get this message when I try to access the php page.

Fatal error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in 

Can anyone tell me what I'm doing wrong?

More info:

  • Mac Pro 1,1 running 10.7
  • Dreamweaver CS6
  • MySQL Server 5.3.3
</div>

I solved this problem. My error was that I didn't have MAMP set up to allow connections from the outside. Google it, there are many good resources out there to help you set it up. After I did that and made sure root access from any IP was enabled, I was good to go. Thanks for everyones help.

IF you are sure that the server is UP and MySQL is running, the following may be true:

When MySQL states it is trying to connect through a local socket, this typically means you are using "localhost" as the address for the MySQL server in your PHP code.

Instead try using the IP Address of the MySQL server.

If this does not fix the problem, then make sure your mysql user that your code is using has permissions to access the MySQL server from 'localhost'.

Let me know if you have any questions about any of this.