Questions tagged [flask-mysql]
103 questions
0
votes
0 answers
flask-mysqldb support for Python 3.6?
Simply I'm trying to connect Flask with MySQL DB
I have Python 3.6 version
and
$pip3 --version
o/p : pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
While installing flask-mysqldb extension getting error mysql config not…

Sanjay Shiradwade
- 85
- 1
- 10
0
votes
2 answers
Flask-MySQL How to effectively INSERT INTO table with parameterized queries
I am trying to build a sign up form with Flask and trying to submit the user entries to MySQL database.
I am not having much success when using parameterized queries. Here is my app.py code:
from flask import Flask, render_template, request,…

JSC
- 21
- 2
- 7
0
votes
1 answer
Trying to use Flask-mysql with python
I'm trying to get Flask to connect to a local MySQL but this keeps failing. I have tried multiple combinations based on other forums
from flask.ext.mysql import MySQL
from flask_mysql import MySQL
from flaskext.mysql import MySQL
etc.
the error I…

Spydernaz
- 847
- 2
- 8
- 14
0
votes
2 answers
display more than one record with mysql and flask
Im trying to get some content from a table
my code looks like:
@app.route('/')
def home():
cursor = mysql.connect().cursor()
cursor.execute("SELECT titlle from cards ORDER BY id desc")
data = cursor.fetchone()
return data
but it…

Fidel Castro
- 277
- 2
- 4
- 10
0
votes
1 answer
got response 200 but nothing happen (flask-mysql)
So I follow this tutorial, and after I reach step Connect Python to MySQL, I got 200 response code, but on postman I see this:
{
"error": "%d format: a number is required, not str"
}
and then I check my table on MySQL, nothing happen, it still…

snow
- 15
- 4
0
votes
2 answers
POST sessionStorage object with AJAX to Flask
I want to post each and every key with value to a function in the Flask framework to store them in a MySQL database. Would I be able do it this way?
JQuery
$.ajax({
type: "POST",
url: "{{url_for('savedata')}}", // Function to send…

Kimberley Chong
- 79
- 1
- 4
- 12
0
votes
2 answers
Error installing flask-mysql python module
I'm trying to install the flask-mysql module and am running into an error. It looks like a problem with vcvarsall.bat, but I'm not really sure what that hints at.
Any ideas from someone more experienced than myself?
C:\eb-virt\bucketlist>pip install…

orangeandgrey
- 81
- 2
- 8
0
votes
0 answers
Creating a bootstrap table with data from MySQLdb in flask
hello guys I am trying to create a bootstrap table with data from MySQL database. I am getting an error local variable data referenced before assignment. Please help my code is as below.
app.py code
@app.route("/viewSingle",…

isaac_34
- 1
- 6
0
votes
1 answer
Fetching mysql row results as dictionary with Python Flask Mysql Cursor class
am trying out creating a web app using python flask framework. I've installed flask-mysql library to interact with mysql db. However, am having trouble getting rows as dictionaries rather than tuples. With the usual python-mysql library, it's a…

David Okwii
- 7,352
- 2
- 36
- 29
0
votes
0 answers
Openshift Flask-MySQL
I have a openshift app written in python and would like to use Flask-mysql
import os
from datetime import datetime
from flask import Flask, request, flash, url_for, redirect, \
render_template, abort, send_from_directory, json
from…

user2459813
- 41
- 6
-1
votes
1 answer
Unable to insert a zulu date into mysql database using flask_mysqldb
When I run the following iwth the value of Job_date being "2023-01-02T21:00:00.504Z"
@api.route('/addjob', methods=["POST"])
def addjob():
f = open('addjob.txt','w')
f.write(str(request.json))
cursor = mysql.connection.cursor()
sql…

BostonMacOSX
- 1,369
- 2
- 17
- 38
-1
votes
1 answer
Error in installing Flask_mysqldb in PyCharm
Hi everyone I am installing Flask_mysqldb in Pycharm and I am experiencing problem.
Is seems to be the only library that I am not able to install.

CIoda Cnaid
- 45
- 7
-1
votes
1 answer
How can I install flask-mysqldb on Python 3.9 on Linux?
I tried installing the package flask-mysqldb on Pop!_OS 20.04. Below is the command I ran and the error I got:
[user]@[host]:~$ python3.9 -m pip install flask-mysqldb
Defaulting to user installation because normal site-packages is not…

manyet1k
- 23
- 1
- 5
-1
votes
1 answer
Best practices for retrieving the most recent data from a database and presenting it on a website
I have the following stack in my project:
Project Structure
Cronjobs are running every 15 minutes to populate the MySQL database with data from the API. At the same moment, the flask app renders this date. So, everytime an user visits the website,…

shapale
- 123
- 2
- 9
-1
votes
2 answers
I'm facing a port problem in flask , how to change port?
OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
my database is in localhost 3306, but my program runs in 5015 port, if I change the port to 3306 instead of 5015 in…