mysql-python

Segmentation fault MySQLdb

杀马特。学长 韩版系。学妹 提交于 2021-01-28 02:06:46
问题 I have installed MySQLdb for python, and have the following code. import MySQLdb conn = MySQLdb.connect(host="hello") Everytime I run this on terminal, I get Segmentation fault (core dumped) But when I put the above lines in hi.py file, and run python hi.py, then I do not see this error in terminal. Could anyone give me an advice to fix this problem? $ python >>> import MySQLdb >>> conn = MySQLdb.connect(host="hello") Segmentation fault (core dumped) This is the command I typed in the

Installing MySQLdb for python 2.7 returns error

两盒软妹~` 提交于 2021-01-28 01:40:59
问题 pip install MySQL-python-1.2.4b4.tar.gz returns this error on Python 2.7 (ubuntu 18.04): Can you help me? # pip install MySQL-python-1.2.5.zip Processing ./MySQL-python-1.2.5.zip Building wheels for collected packages: MySQL-python Running setup.py bdist_wheel for MySQL-python ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-00mbCK-build/setup.py';f=getattr(tokeni ze, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f

pip install MySQL-python

為{幸葍}努か 提交于 2021-01-27 17:26:29
问题 I'm trying to install MySQLdb for Python on Mac OS. When I digit pip install MySQL-python shell returns to this: Collecting MySQL-python Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/private/var/folders/9h/2lp9kx993ygbrfk1lxr0sz500000gq/T/pip-install-7xyyBe/MySQL-python/setup.py",

cursor.fetchall() returns extra characters using MySQldb and python

∥☆過路亽.° 提交于 2020-12-29 13:19:49
问题 When I'm using python to fetch results from a SQL database I get extra charters at the beginning and end of the returned value. For example the below code returns ((56L,),) instead of 56, does anyone know how to get just the value... and what the (( ,),) actually mean...? hp= 56 id= 3 database = MySQLdb.connect (host="localhost", user = "root", passwd = "", db = "db") cursor = database.cursor() cursor.execute("UPDATE period_option SET points =%s WHERE period_option_id =%s", (hp, id)) cursor

cursor.fetchall() returns extra characters using MySQldb and python

旧街凉风 提交于 2020-12-29 13:19:42
问题 When I'm using python to fetch results from a SQL database I get extra charters at the beginning and end of the returned value. For example the below code returns ((56L,),) instead of 56, does anyone know how to get just the value... and what the (( ,),) actually mean...? hp= 56 id= 3 database = MySQLdb.connect (host="localhost", user = "root", passwd = "", db = "db") cursor = database.cursor() cursor.execute("UPDATE period_option SET points =%s WHERE period_option_id =%s", (hp, id)) cursor

Python mysql-connector multi insert not working?

99封情书 提交于 2020-12-06 06:29:06
问题 I just started using the Mysql Connector library for Python and I seem to be running into an issue I can't get my head around. I have Python dynamically generate Insert statements to be executed on MySQl database. I batch them together in one string and then I execute every n together in the one cusrsor.execute() statement however for some reason when I check the DB and table, the new rows are nowhere to be found. I tried it with even just two insert statements together and they still didn't

Python mysql-connector multi insert not working?

风格不统一 提交于 2020-12-06 06:27:07
问题 I just started using the Mysql Connector library for Python and I seem to be running into an issue I can't get my head around. I have Python dynamically generate Insert statements to be executed on MySQl database. I batch them together in one string and then I execute every n together in the one cusrsor.execute() statement however for some reason when I check the DB and table, the new rows are nowhere to be found. I tried it with even just two insert statements together and they still didn't