Using MySQL in Pydev Eclipse

I am trying to access a MySQL database with python through Pydev Eclipse. I have installed the necessary files to access MysQL from python and I can access the database only when I write code in...

Handle mysql restart in SQLAlchemy

My Pylons app uses local MySQL server via SQLAlchemy and python-MySQLdb. When the server is restarted, open pooled connections are apparently closed, but the application doesn't know about this...

MySQL: Get column name or alias from query

I'm not asking for the SHOW COLUMNS command. I want to create an application that works similarly to heidisql, where you can specify an SQL query and when executed, returns a result set with rows...

Python MySQLdb issues (TypeError: %d format: a number is required, not str)

I am trying to do the following insert operation: cursor.execute(""" insert into tree (id,parent_id,level,description,code,start,end) values...

PyMySQL can't connect to MySQL on localhost

I'm trying to connect to MySQL on localhost using PyMySQL: import pymysql conn = pymysql.connect(db='base', user='root', passwd='pwd', host='localhost') but (both on Python 2.7 and Python 3.2)...

mysql-python installation problems (on mac os x lion)

I installed everything successfully, or so I thought: MySQL 5.5 for x86_64. Python 2.7, x86_64. mysql-python 1.2.3, x86_64. But when I try: import MySQLdb I get: ImportError:...

Python 32-bit can't find MySQLdb module on OS X Lion

I've been tearing my hair out and trying the solutions to getting Python and MySQL to play nicely with 64-bit architecture, and the solution seems to have all components installed/run as...

Mac OS X 10.6, Mysql, Mysql-Python, Django

UPDATE: I came across this post: https://stackoverflow.com/questions/5072066/python-mysqldb-on-mac-osx-10-6-not-working saw two options: Add MySQL client libraries to the...

Lessons starting Django/Python/MySQL on OSX (from OSX newbie)

I am somewhat new to coding and wanted to start my first Django app with a MySQL backend. I've used this setup for almost a year now on my windows machine, but it was an inherited codebase - and I...

How to test database connectivity in python?

I am accessing a MySQL database from python via MySQLdb library. I am attempting to test the database connection as shown below. db = MySQLdb.connect(self.server, self.user, ...

get raw decimal value from mysqldb query

I am executing a mysql query in python using the MySQLdb package. The code looks something like this: c=db.cursor() c.execute("""select * from table""") output = [] for row in c: ...

ImportError: this is MySQLdb version (1, 2, 4, 'beta', 4), but _mysql is version (1, 2, 5, 'final', 1)

I've installed MySQL-python on mac with following procedure : pip uninstall MySQL-python brew install mysql pip install MySQL-python Then test it : python -c "import MySQLdb" When I test it,...

Python MySQLdb/mysqlclient: bind a named set (or tuple or list) as parameter

Background: Not much documentation on MySQLdb Connector Maybe I'm looking in the wrong places, but there's not much documentation about Python's MySQLdb family of connectors. Perhaps PEP249 is...

PyMySQL is not working as a alternate MySQLdb module for Python 3.4

I'm trying to install a Python 3 alternative to python-mysql. I tried with the recommended PyMySQL. But the same error persists when trying to migrate my Django project. Traceback: File...

Specifying dtypes for read_sql in pandas

I would like to specify the dtypes returned when doing pandas.read_sql. In particular I am interested in saving memory and having float values returned as np.float32 instead of np.float64. I...

What's the difference between MySQLdb, mysqlclient and MySQL connector/Python?

So I've been trying to do some database update with python and while setting up the whole dev environment, I came across these three things which made me dizzy. There's MySQLdb There's...

Installing MySQL-python causes command 'clang' failed with exit status 1 on Mac OS 10.13.15

I have installed tools via xcode-select --install but still show the following error while doing pip install MySQL-python Building wheels for collected packages: MySQL-python Running setup.py...

Python 3.7, Failed building wheel for MySql-Python

I am new to python and I am trying django framework that involves some MySql and ran into this error when try to do pip install mysqlclient and down the lines of cmd messages I got this. Failed...

Issues installing MySQLdb with Python 3.6.5: Can't open 'mysql.h' - and Can't open : 'config-win.h': No such file or directory

I am trying to use mysql with python SQLAlchemy however python fails to install MySQL or even recognize it is installed. Below are the details: I'm running this on Windows 10 64 bit and Anaconda...

pip install mysqlclient returns "fatal error C1083: Cannot open file: 'mysql.h': No such file or directory

Here is this issue: I attempt to install mysqlclient like so C:\Users\amccommon349>pip install mysqlclient Collecting mysqlclient Using cached...

django.db.utils.ProgrammingError: (1146 table doesn't exist)

I have an problem with migrations in python django. When i try to execute python manage.py makemigrations or migrate there is this error.🤷‍♂️ Traceback (most recent call last): ...

Install mysqlclient via pipenv throw errors

I'm using django and mysql. To communicate django with mysql, have to install mysqlclient. Also python version is 3.7.2 pipenv install mysqlclient it throws errors. Installing mysqlclient... ✔...

django.db.utils.OperationalError: (2013, "Lost connection to MySQL server at 'handshake: reading inital communication packet', system error: 0")

I am developing an app in django to push it on Heroku, and while trying to migrate a database in mysql to heroku, I pip installed mysql-python and as I try to run the server, I got this...

python3 install mysqlclient and get error :‘MYSQL_DEFAULT_AUTH’ undeclared

[[email protected] mysqlclient-python-master]# python3 setup.py install /usr/local/python3/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option:...

NameError: name '_mysql' is not defined after setting change to mysql

I have a running Django blog with sqlite3 db at my local machine. What I want is to convert sqlite3 db to mysql db change Django settings.py file to serve MySQL db Before I ran into the first...

How to Install mysqlclient for Django in windows 10?

i am new in Django.i want to use Mysql database for my project.i am installing mysqlclient for that, but its showing below error. i am using --pip install mysql-python command for installing...

Django connect mysql problem, NameError: name '_mysql' is not defined

I found MySQL database cannot start properly, so I uninstall Mysql 5.7. I installed MySQL 8.0.21, I found that my Django project has a problem. I would like makemigrations on my Django project...

NameError: name '_mysql' is not defined -- On airflow start in MacOSX

There are numbers of articles on the titled question but none of them worked for me. The detailed error is as follows: Traceback (most recent call last): File...

connection error between two devices: ImportError: libmariadb.so.3: cannot open shared object file: No such file or directory

I have two devices that I use as MySql server and Django server. My system, which works on my development device, becomes inoperable when it switches to other devices. Settings on...

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 180: invalid start byte

I'm using Django with below config in settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': '-', 'USER': '-', 'PASSWORD': '-', ...