0

I'm trying to connect to my localhost MySQL server via php in the terminal.

It's outputting that it cannot connect to the host through my socket. My PHP ini install says this

MYSQL_SOCKET    /tmp/mysql.sock

so i used

mysql_connect("/tmp/mysql.sock","root","","");

And I get errors

Any suggestions?

1 Answer 1

1

Did you try

mysql_connect(":/tmp/mysql.sock","root","","");

like mentioned in the manual.

BTW: Posting what errors you get might help when asking questions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.