Can't connect to MySQL from python in pipenv

75
December 17, 2018, at 4:30 PM

I have problem accessing my mysql db from pipenv (2.7) envirnonment.

Outside the environment I am able to execute

conn = pymysql.connect(host="localhost", unix_socket="/var/run/mysqld/mysqld.sock", port=3306, user="root", passwd="helloworld")

and it establishes the connection successfully. When I try the same in the pipenv shell it throws following error:

OperationalError: (2003, "Can't connect to MySQL server on 'localhost' (255)")

Additionally if I execute mysql -u root -p insidet the envirnonment shell I can correctly connect to the mysql server (so it is running).

READ ALSO
Join query to get records matching 2 values in one column

Join query to get records matching 2 values in one column

So, I have a movie table (movie), a category table (cat), and their relation table (movie_cat)The "movie" table has values

97
MySQL using Temp Tables (Learning)

MySQL using Temp Tables (Learning)

I am currently learning SQL in order to make a simple RFM report from our Magento Database, I can currently do this by exporting two queries and pasting them into a Excel template, I'd like to get rid of the Excel template

100
which database to choose for these use case [on hold]

which database to choose for these use case [on hold]

I have the following use cases to achieve in database layer, If somebody could show me some light It would be Great,

138