Skip to main content

Python Flask Website DB Connection Problem

Answered

Comments

2 comments

  • ümit öztürk

    Hello, i found a solution to my problem and i would want to publish it too.

     

    Here is the solution for me :

     

    First enter the database that you are working in and open sql query page and paste that command :

    SHOW VARIABLES LIKE 'socket';

    output for me : 

     

    put value to DB config section like this :

    DB_CONFIG = {
    "user": "username",
    "password": "password",
    "database": "database",
    "cursorclass": pymysql.cursors.DictCursor,
    "unix_socket": "var/lib/mysql/mysql.sock"
    }
     
    and voila, that was the fix for me.

     

     

    0
  • cPRex Jurassic Moderator

    I'm glad you were able to get that working, and thanks for sharing the solution!

    0

Please sign in to leave a comment.