Error connecting to database in Aptana studio 2 with php
When I try to connect to the database with the php command:mysqli_connect("localhost","us开发者_开发百科ername","password") I take the message below:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/pinkonomy/Aptana Studio Workspace/sokratakos/scot.php on line 2
How to solve this?What is the problem with this?
Thanks in advance
I has a similar problem and changed localhost to localhost.localdomain as it is in my hosts file and that also fixed the problem.
精彩评论