0

I try to reach to my remotemysql database with my Python script which worked fine first, now it doesn't connect anymore so I went to remotemysql.com/login.php but it gives an error

Connection failed: SQLSTATE[HY000] [2002] No such file or directory

anyone know if its only for me or if remotemysql.com is having problems? my code for Python should also be fine. these are random credentials in my code btw.

try:
    conn = mysql.connector.connect(
      host='remotemysql.com',
      database='thydfc2',
      user='thydfc2',
      password=os.environ.get('databasepass'))

  except Error as e:
    print(e)
  if conn.is_connected():
      mycursor = conn.cursor()```
Jason Aller
  • 3,541
  • 28
  • 38
  • 38
sub joel
  • 1
  • 3
  • Did you just expose your database credentials? – Shadow Dec 20 '22 at 12:43
  • Btw, the error message does not make sense for a remote mysql database as it indicates that you are trying to connect through sockets file. Sockets file can only be used for localhost access, not for remote. – Shadow Dec 20 '22 at 12:46
  • i am not exposing my password, and i am trying to login on the website without any code then i get that error code, with python i just get error connection failed – sub joel Dec 20 '22 at 12:55

0 Answers0