Questions tagged [flask-mysql]
103 questions
50
votes
2 answers
error: Skipping analyzing 'flask_mysqldb': found module but no type hints or library stubs
I am using Python 3.6 and flask. I used flask-mysqldb to connect to MySQL, but whenever I try to run mypy on my program I get this error:
Skipping analyzing 'flask_mysqldb': found module but no type hints or
library stubs.
I tried running mypy…

rsev4292340
- 599
- 1
- 4
- 7
50
votes
5 answers
Problems with flask and bad request
I was programming myself a pretty nice api to get some json data from my gameserver to my webspace using json,
but everytime i am sending a request using angular i am getting this:
127.0.0.1 - - [20/Mar/2018 17:07:33] code 400, message Bad request…

Lars Erhardt
- 529
- 1
- 5
- 8
5
votes
6 answers
Getting "Library not loaded: libssl.1.0.0.dylib", "Reason: image not found" with flask_mysqldb
I'm trying out Python 3 with Flask and I'm stuck with the following error while working with databases.
I'm doing this on macOS High Sierra v. 10.13.6
My import code is as follows:
from flask import Flask, render_template, flash, redirect,…

M. Quist
- 211
- 1
- 2
- 8
4
votes
1 answer
Flask-Mysql type error when update data
I'm having a strange bug when I write a website with flask and package flask-mysql.
Here is the code of the bug function:
@app.route('/calendar/editeventtitle',methods=['POST'])
def editeventtitle():
if not session.get('logged_in'):
…

Minalinsky
- 277
- 6
- 16
3
votes
1 answer
Error encountered while installing dependencies for flask-mysql application using requirements.txt file in AWS Elastic Beanstalk
I am trying to deploying a flask application which uses mysqlclient module. I added "mysqlclient==2.0.3" in the requirements.txt file but it is giving me an error as mentioned:
Hoping to get a solution in order to resolve this and deploy my…

Karishma Londhe
- 31
- 2
3
votes
2 answers
Connect to multiple database from Flask using flask_mysqldb
I have a Flask application that connect to one db(db1) using flask-mysqldb module
app.config['MYSQL_HOST'] = 'host1'
app.config['MYSQL_USER'] = 'user1'
app.config['MYSQL_PASSWORD'] = ''
app.config['MYSQL_DB'] = 'db1'
app.config['MYSQL_CURSORCLASS']…

rsev4292340
- 599
- 1
- 4
- 7
3
votes
3 answers
How to install Flask-mysqldb for Python?
I am new to Python and Python-Flask and have ran into an error. I am using Ubuntu 18.04.3 LTS and Python 2.7.15+ to build a python-flask web application.
When installing flask-mysqldb I run into an error.
$ pip install flask-mysqldb
The full…

Rose
- 71
- 1
- 2
- 9
3
votes
1 answer
MySQLdb._exceptions.OperationalError ('1046, No database selected') - flask to mySQL connection error
I have spent so much time trying to figure this out and I am lost.
I am trying to make a small web app, watching some tutorials...
I keep getting this error: MySQLdb._exceptions.OperationalError ('1046, No database selected')
This is my code:
#…

KingAlmond
- 93
- 2
- 8
2
votes
1 answer
Flask-Mysqldb NameError: name '_mysql' is not defined
I've been trying to solve this problem for a while now.
I tried everything I can find and still nothing. Kindly help.
from flask import Flask, request, jsonify
from flask_mysqldb import MySQL
app = Flask(__name__)
app.config['MYSQL_USER'] =…

theguy
- 21
- 1
- 2
2
votes
2 answers
error during installation of flask-mysqldb (python 3) on a mac (OS High Sierra)
While following an online tutorial to create a Flask web-app, I was trying to install flask-mysqldb with sudo pip3 install flask-mysqldb. This results in an installation error which seems to stem from a dependency problem. The error message is as…

Dan
- 63
- 1
- 5
2
votes
2 answers
How to make this Flask-mysql insert commit?
I'm still using Flask-mysql.
I'm getting the database context (the mysql variable) just fine, and can query on the database / get results. It's only the insert that is not working: it's not complaining (throwing Exceptions). It returns True from…

JakeJ
- 2,361
- 5
- 23
- 35
1
vote
0 answers
MacOS cannot install flask-mysqldb
I am trying to install "flask-mysqldb" library but it cannot be installed due to mysqlclient.
ld: library not found for -lzlib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed…

Oguz Gokyuzu
- 13
- 3
1
vote
1 answer
How do we get data from the user in json format with request.form with Flask?
I am making a user management system application, a user can have more than one admin, so one of my columns in mysql is in json format, but how do I update this column, how do I add it? When I try to update the request.form with the data I get from…

Bilge Kaan Özkan
- 33
- 3
1
vote
1 answer
502 Bad Gateway Error when adding mysql.connector in my Flask application
When I run my flask application on my local machine I am able to execute queries successfully from my sql database in google cloud. However, when I deploy my app onto the google cloud platform, it throws me a "502 Bad Gateway" error once it…

snakshak12
- 72
- 6
1
vote
2 answers
Python flask_mysqldb passing over 10 does't work
I'm totally new and learning Python+MySQL,
And I have an issue with passing over 10 to %s
@app.route('/usr/', methods=['GET'])
def selected_logs(id):
response_object = {'status': 'success'}
cur = mysql.connection.cursor()
…

be able
- 71
- 1
- 9