0

i am trying to connect mysql DB with xampp in linux centos . but i am getting error like this .

Mysql Error : 2002- mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2).

i have stopped mysql server that was running separately in linux . so xampp is working properly mysql -->ok ,apache in xampp -->ok .

and i have checked phpmyadmin and previllages for root . you can check that http://74.205.66.7/phpmyadmin/.

thanks for help.

0

Did you check your firewall? Refer to this link to enable connection to port 3306 if you are using iptables:

http://www.cyberciti.biz/tips/linux-iptables-18-allow-mysql-server-incoming-request.html

  • no , i did not checked firewall. – Waqas Rana Oct 17 '16 at 6:25
  • @WaqasRana try turning it off and check the connection to find out whether it is the cause. If so then add required firewall rules. – Bambang Oct 17 '16 at 6:42
  • 74.205.66.7/phpmyadmin ...check that , i am able to access phpmyadmin online . then how firewal issue? – Waqas Rana Oct 17 '16 at 6:50
  • i have added my ip in firewall , so i have to give my ip address instead of localhost in making connection to mysql. am i right? – Waqas Rana Oct 17 '16 at 6:54
  • @WaqasRana if your are connecting from localhost no need to put the ip address. Did you check this post: stackoverflow.com/questions/19658891/… – Bambang Oct 17 '16 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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