new

Stack Overflow for Teams

A private, secure home for your team's questions and answers.

Learn more
0
votes
1answer
23 views

Concat function returns 1 on MySQL query on Flask

I run MySql query in flask with concat function and it always returns 1. cur.execute("INSERT INTO jobs( job_id, job_name, company, who_created) VALUES(%s,%s, %s,%s)",(job_id,job_name, company, [cur....
1
vote
0answers
233 views

sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (2059, "Authentication plugin 'caching_sha2_password'

I am learning to implement Flask application. And using mysql as a database. I tried MySQLdb, flask_mysql & flask_sqlalchemy. But still getting this error, when i try to perform any action on ...
0
votes
1answer
25 views

Flask-MySQLdb not working with gunicorn and flask

I am using Flask and MySQL(Ver 14.14 Distrib 5.7.20, for osx10.13 (x86_64)) inside a virtualenv. If I run the following app.py file using the command python3 app.py, everything runs perfectly. But, if ...
0
votes
0answers
32 views

Python Flask, UPDATE TABLE

I am writing this message regarding a problem i have, I cant find the error but somehow my table wont update its just keep refreshing same page. I have following problem that my mysql table wont ...
-1
votes
1answer
94 views

installing mysqldb for flask ERROR [OSX]

macOS 10.13.2 Python 2.7.14 Hi all! I'm currently working on a website made in python (flask), but I'm experiencing an issue when I try to install MYSQLDB for python. I want to use it for my database ...
-1
votes
1answer
49 views

flask_mysqldb Delete FROM variable table [duplicate]

So i use flask_mysqldb in a Flask(Python website) I'm trying to write a function to delete a row in any table. It works perfectly when I hardcode the tablename, but what do I need to do to be able to ...
-3
votes
1answer
56 views

Inserting HTML into mysql Database showing Type Error [duplicate]

I am developing a Webapp using Flask. At some point, I have to insert a certain HTML script into a MySQL database: <h3>Welcome!</h3> <p>Some text</p> When I insert it into ...
1
vote
0answers
222 views

How to get login logs using Flask/MySQL

I would like to display the login logs (who connected and when) after the login screen, on the home page for example (so the user sees when he logged in last time) and store the data in a file if ...
1
vote
1answer
399 views

select entries from database mysql in dropdown, python flask

I want to select data from database table in MySQL. It is procedure in Python @app.route('/formworkers.html') def formworkers(): cursor = mysql.connection.cursor() cur = cursor.execute("SELECT ...
-1
votes
1answer
293 views

Python: How to run flask mysqldb on Windows machine?

I've installed the flask-mysqldb module with pip package management system on my Windows machine and I don't know how to run it. I have tried to add the path to the MySQLdb in System properties and ...
0
votes
0answers
15 views

Using MySQLdb --> conn.select_db() with Flask [duplicate]

I've just figure it out that MySQLdb also has conn.select_db() fuction. Then I'd tried to combine it with Flask at the same time. Here's my code: from flask import Flask from flask import request ...
1
vote
1answer
368 views

how to validate credentials in flask/python with mysql?

Flask/python validation for login is not working for me with mysql, i was searching google and documentations and i have seen few questions on stack-overflow on same thing but haven't been answered ...
0
votes
1answer
26 views

What is proper syntax for mysqldb to avoid sql-injection?

I'm building a web application via the Flask framework, and am trying to use html forms to retrieve user data which will ultimately be stored in a mysqldb database. I initially was passing my python ...
0
votes
0answers
85 views

ImportError: cannot import name rdbms_googleapi

when I migrate my database, i see that error. i did init. (python manager.py db init) and. migrate (python manager.py db migrate) i use google app engine, flask, mac, python what should i do? ...
0
votes
0answers
264 views

How to get a connection in Flask MySQLdb using 'g'

When I try to connect to MySQL I get an error closing a closed connection, I followed this Flask Database Connections . I have nowhere initialised the extension twice. Am getting error doing this, ...
0
votes
1answer
58 views

Listing table results to HTML with Flask

I am struggling with passing my SELECT all statement results to my view. I am using flask and MySQLdb. What is the proper syntax to display all my results from my table to my HTML page? I would love ...
0
votes
0answers
95 views

SELECT statements not grabbing data with Python Flask

Attempting to gather info on a client when they login. The info was previous entered into the database. I am getting all "1"s back except the email value because the user has to enter the email ...
0
votes
0answers
117 views

Python / Flask development / Bad request 400

I am just wondering if someone can help get through this 404 error. I have checked the other requests that worked, and found no difference from this code that is getting the error whenever I submit ...
0
votes
2answers
1k views

Python Flask inserting data from form

This is a beginners attempt for inserting data into a mysql table using flask. I can enter data in the form, but it doesn't insert the data. I'm using pythonanywhere, so the error message is not clear....
0
votes
1answer
402 views

GAE ImportError: dynamic module does not define init function (init_mysql)

My staging GAE app throws the below err, File "/base/data/home/apps/foo156801/worker:20170301t222555.399535951340506041/lib/MySQLdb/__init__.py", line 19, in <module> import _mysql ImportError: ...
1
vote
2answers
109 views

Error 1064 sql syntax error

I am trying to work on registration using WTF forms and I am facing a sql syntax error when I am trying to inject data through flask execution. But I can able to insert the data using normal sql query ...
0
votes
2answers
181 views

Flask mySQLDB execute success or failure

I am new to Python-Flask and am trying to use MySQLDB to conenct to the database. However, I am unable to determine how to check if the query executed by the cursor is successful or if it failed. In ...
0
votes
1answer
159 views

Validate login using javascript from a login page by clicking on “Login button”

Suppose I have a javascript for a "Log in" button in a login.html page. The javascript can look like this var attempt = 3; // Variable to count number of attempts. // Below function ...
0
votes
1answer
38 views

How to store data in a database to identify process started on the server

Could you enlighten me how to store data in a database to identify process started on the server? Code is below. I run it on Flask (python) with MySQL database on Cloud 9. To sump up, I do not want ...
1
vote
1answer
181 views

Flask_SQLAlchemy, MySQL, store Swedish characters å, ä, ö?

I can't sto re Swedish characters in MySQL by using Flask_SQLAlchemy :( I have tried to find a solution for a week now and I really need help as it feels like I have reached a dead end. I think it ...
1
vote
1answer
229 views

Flask-MySQLdb raises _mysql_exceptions.ProgrammingError: closing a closed connection

I'm trying to use Flask-MySQLdb. Every time I go to a page I get the error _mysql_exceptions.ProgrammingError: closing a closed connection. Why isn't this working? from flask import Flask, ...
0
votes
1answer
318 views

Flask-MySQL gives “closing a closed connection” error the second time a view runs

I am using Flask-MySQL to connect to my database in a view. The view works the first time I go to it, but when I go to it the second time it always crashes with the error: ProgrammingError: closing ...
1
vote
1answer
813 views

Call a MySQL stored procedure with Flask-MySQLdb

I've created a stored procedure spCreateUser in MySQL and I need to pass two arguments to it using Flask-MySQLdb. What is the correct way to pass multiple arguments to a stored procedure? I tried ...
0
votes
0answers
7 views

Debug mode generates two process when using MySQLdb (python-mysqldb) [duplicate]

I would like to understand, why my Flask App is opening two connections to MySQL server, when I run the Flask App with Debug mode. #!/usr/bin/python from flask import Flask, render_template, ...
0
votes
1answer
1k views

Programmingerror - closing a closed connection

Here is code from a tutorial I've been working for python web development in flask: from flask import Flask, render_template, json, request from flask.ext.mysql import MySQL from werkzeug import ...
0
votes
2answers
2k views

TypeError: 'Connection' object is not callable

Hi I'm following a tutorial online to build a flask web app and keeping coming across this error when I try to store information into my db via the sign up button. from flask import Flask, ...
3
votes
1answer
3k views

MySQLdb raises “execute() first” error even though I execute before calling fetchall

I'm getting the following error while trying to use MySQLdb with Flask. _mysql_exceptions.ProgrammingError: execute() first The print output shows me that "After fetch" never gets printed, meaning ...
0
votes
1answer
776 views

Heroku hosting flask app with MySQL throwing errors

I'm new to Flask and heroku but I built a simple app and pushed it to heroku using SQLite. After migrating the app to a remote mysql db I noticed that can't get the app running because I'm getting the ...
0
votes
2answers
292 views

MySQL delete query doesn't execute

I want to check for duplicate contacts and remove them from the user's contact list. There is no error message, it simply doesn't execute. Why doesn't it work? cmd = "DELETE FROM contacts WHERE ...
3
votes
3answers
7k views

How to create a mysql connection pool or any better way to initialize the multiple databases?

In my code I am opening two mysql connections and using HTTP requests to insert data into database g.db = mysql.connector.connect(user=a ,password=password, host=localhost,database=mysq1) g.db1 = ...
2
votes
1answer
2k views

Error importing module flask.ext.mysqldb

So I am trying to create a web app that is linked to a MySQL database using Python, Flask and MySQLDB. I went to MySQLDBs documentation here. I have copied the code from the documentation correctly, ...
3
votes
2answers
3k views

UnboundLocalError: local variable 'cursor' referenced before assignment

So I am a newbie but working on a registration system form in flask/MYSQL I am receiving this error (UnboundLocalError: local variable 'cursor' referenced before assignment) After hours of playing ...
0
votes
0answers
71 views

ImportError: No module named MySQLdb. os x 10.9. Flask [duplicate]

running the following python code: @app.route('/testdb') def testdb(): if db.session.query("1").from_statement("SELECT 1").all(): return 'It works.' else: return 'Something is broken.' ...
64
votes
10answers
136k views

ImportError: No module named MySQLdb

I am referring the following tutorial to make a login page for my web application. http://code.tutsplus.com/tutorials/intro-to-flask-signing-in-and-out--net-29982 I am having issue with the database. ...
-1
votes
1answer
211 views

wrong architecture error mysql python

i use flask.I installed MySQL using easy_install mysql-python and then tried to run my app.py but got this lines of error.What is those mean? Traceback (most recent call last): File "app.py", line ...