0

i'm trying to upload my school project on my personal Aruba domain. I have uploaded all the file on the server and the site is working untill i try to connect to the online database i've uploaded. It gives me this

Connection failed: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I'm using PDO to do the connection.

 $dbh = new PDO('mysql:host=<ip_address>;dbname=test', $user, $pass);

Can you guys help me?

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
G4bisz
  • 19
  • Database daemon running? Port open? Connection viable? One of other million possible things? Come on, we're not tech support. This is googlable and self-solvable. – Kevin Kopf Apr 29 '18 at 20:24
  • there is a reason why i posted here, because on the internet nobody talks about this... – G4bisz Apr 29 '18 at 20:27
  • About your *"Instead of "localhost" there is the database ip"* - Why does the code you included contain `localhost`? – Funk Forty Niner Apr 29 '18 at 20:33
  • *"because on the internet nobody talks about this"* - [Oh, really?](https://duckduckgo.com/?q=Connection+failed%3A+SQLSTATE%5BHY000%5D+%5B2002%5D+Can%27t+connect+to+local+MySQL+server+through+socket+%27%2Fvar%2Flib%2Fmysql%2Fmysql.sock%27&t=lm&atb=v112-6_g&ia=qa) < click that. – Funk Forty Niner Apr 29 '18 at 20:34
  • Cause i didn't want to show the ip (?) – G4bisz Apr 29 '18 at 20:35
  • All the solutions in the internet are for local databases, not online. I do not have access to mysql folders on the aruba machine, this is why i've asked . – G4bisz Apr 29 '18 at 20:40
  • *"All the solutions in the internet are for local databases, not online."* - I sincerely doubt that. I won't stay here any much longer. Voting to close. – Funk Forty Niner Apr 29 '18 at 20:42
  • I closed this question as a duplicate. If the answers from the duplicate don't fully address your question please ask another question and provide more details. – O. Jones Apr 29 '18 at 20:48

0 Answers0