3,184 questions
0
votes
1
answer
48
views
No connection to MySQL-database - PythonAnywhere/ Beginners Plan
Attempt to connect to MySQL-database by module MySQLdb fails and will be responded by: name 'MySQLdb' is not defined... in the servers log. Environment is not virtual, framework is Flask
The ...
0
votes
0
answers
68
views
Building wheel for mysqlclient (pyproject.toml) did not run successfully
I'm trying to install mysqldb on python3.8 (Windows 11 24H2).
I initially had issues with VSC++14 but I managed to solve them.
pip install -U flask_mysqldb
error: subprocess-exited-with-error
...
0
votes
0
answers
50
views
Python 3 Flask MySQL connection and handle error
I am build a system include server, mobile app and desktop app.
server.py
from flask import Flask, jsonify, request, g, send_file
from flask_cors import CORS
import mysql.connector
import data.data as ...
0
votes
0
answers
25
views
Mysql 5.5..33 : (5010, "Authentication plugin 'mysql_old_password' couldn't be found in restricted_auth plugin list.") [duplicate]
When I am trying to connect the MySQL db that hosted in remote via the python library MySQLdb, I am getting the following error.
(5010, "Authentication plugin 'mysql_old_password' couldn't be ...
0
votes
3
answers
359
views
mysql.connector.connect failing to connect
While trying to connect Python with SQL, it just does not work, with no errors, the execution stops itself, here's the code:
import mysql.connector
def appen():
print('k')
mysq = mysql....
1
vote
1
answer
72
views
Saving data to the database in django [duplicate]
I am working on a website to recommend stocks on the stock market, based on historically reliable trading strategies.
When running the server, I can't see any of the data which is supposed to be shown ...
0
votes
0
answers
36
views
I am having a problem in MySQL connection in Python which I never had before [duplicate]
Traceback (most recent call last):
File "S:\Python\lib\site-packages\mysql\connector\network.py", line 733, in open_connection
self.sock.connect(sockaddr)
ConnectionRefusedError: [...
0
votes
0
answers
77
views
Unable to connect MySQL (xampp) using Python
import mysql.connector
conn = mysql.connector.connect(host="localhost", user="root", password="")
if conn.is_connected():
print("Successful")
else:
...
0
votes
0
answers
38
views
Wagtail django.db.utils.OperationalError: (1463, "Non-grouping field 'numchild' is used in HAVING clause")
I'm working on a Django project and I've encountered an issue that I'm unable to resolve. When I try to run my application, I get the following error:
django.db.utils.OperationalError: (1463, "...
0
votes
1
answer
70
views
Can't connect to mysql database from the python code using mysql.connector
I m unable to connect to my database and it gives this error that object is not callable. I did search up the error and even what it means. I changed a lots of stuff in the code but it didn't work for ...
0
votes
1
answer
84
views
Permission danied when reading file from /var/lib/mysql-files
I am using cursor.execute to generate the file my_file.csv and save it in /var/lib/mysql-files.
Here is my code:
import mysql.connector
connection = mysql.connector.connect(host='localhost', port='...
1
vote
0
answers
20
views
Error to parse pickled data to/from database [duplicate]
I am trying to store pickled object into database and unpickle it back.
Data is being stored in database, however after reading data its throwing an error during unpickle.
Traceback (most recent call ...
2
votes
0
answers
122
views
How do I use a loop to update the progress of my entire code in python using a progress bar
I have a code that pulls data from mysql database using python mysql connector and I want to create a progress bar in python using tkinter that shows query execution progress.
I have created a loop ...
0
votes
0
answers
31
views
ERROR: root: Error fetching patient details: PatientView.html
I'm trying to create a simple webpage using Flask. I have written code to fetch data from a MySQL database, but the code is not working, and I keep getting the error:
Error:
root: Error fetching ...
1
vote
0
answers
55
views
SQLAlchemy difference between regular query and text
I am trying to insert new rows in a table that might already exist with constant values given from my application.
I have tried to create the following code:
with engine.begin() as con:
con....
0
votes
1
answer
41
views
How to make a flexible argument list for cursor.execute in python3?
In fact, I want to increase and decrease the mysql query items and the values (arguments) according to the status of the variable values.
based on my scenario I need to make a flexible mysql query ...
0
votes
1
answer
614
views
Error installing mySQLDB using pip Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
Unable to run django application in the latest amazon Linux AL2023 running python3.9
It reports mySQLDB module is not installed, I tried installing mysql module using pip and yum but nothing helped to ...
0
votes
0
answers
57
views
Error when trying to upload an SQL file using the source command in MySQL
I am a fairly new student currently enrolled in Python and SQL for Data Science course from a website called Scaler. As part of the course, I am trying to understand the concepts of MySQL.
The ...
0
votes
0
answers
102
views
UnicodeDecodeError when opening a .sql file using pandas read_sql_query
I need to analyze data from sql server. The process is memory heavy which requires me to use my university's computing resources as opposed my personal computer. Due to university policy, I cannot ...
1
vote
2
answers
135
views
Python MySQL: DatabaseError: 1364 (HY000): Field 'emp_no' doesn't have a default value
I've installed MySQL on my Windows desktop. The installation was successful. I downloaded the employees data from github and added it to my MySql server. I confirmed that through the MySQL 8.4 ...
0
votes
1
answer
732
views
Python 3.12 Connecting to local MySQL error
I've been using a Python script for a couple of years without a problem on Xubuntu 20.04, now on 24.04, I’m getting errors connecting to the MySQL server on the same machine.
Relevant code:
import ...
1
vote
0
answers
46
views
Python mysql.connector commands out of sync; you can't run this command now when executing stored proc
I am calling a function that uses a db cursor twice to retrieve data and pass it to an html file.
@app.route("/EditSubjects", methods = ["POST"])
def editSubjects():
if session....
0
votes
1
answer
30
views
How to add value to a newly inserted column in sql using Python Mysql? [duplicate]
I am getting errors while inserting value to a newly added column.
import mysql.connector
mydb = mysql.connector.connect(
host = 'localhost',
username = 'rt',
password = 'rt',
database ...
-1
votes
1
answer
69
views
Many to Many relationship get all grouped records
I have the following three tables in a mysql database:
grades:
id
st_id
Q1
Q2
1
20001
93
89
2
20002
86
84
3
20003
82
83
4
20001
86
89
5
20002
89
54
6
20003
81
94
subjects:
id
subject
yr
1
English
2023
...
0
votes
1
answer
67
views
MySQLdb installation issue on Mac. Required for MySQL connectivity with Django
I am creating a Django project on Mac. I want to use MySQL for database. I am trying to install MySQLdb which gives the following error:
(djangodev) $ pip3 install MySQL-python ...
1
vote
2
answers
343
views
Can't connect python server and mysql with Docker compose
I am newly learning Docker and compose, I have searched and watched many tutorials but could not understand what is causing this connection error:
_mysql_connector.MySQLInterfaceError: Can't connect ...
0
votes
0
answers
85
views
MySQL Connector returning "None" when there is data
I'm using Python MySQL connector and I know there is a table named "users" in this db. I keep running into this issue no matter what I try (show tables, select * from users, etc). I even ...
1
vote
0
answers
45
views
Save output from async function, and store it to MySQL database
I am working on making a API call and saving the data and storing it to MySQL database using Python.
Below is a portion of my code:
async def main():
user = input("Enter username: ")
...
0
votes
0
answers
100
views
In AWS, i had a RDS with active connections. I am able to retrieve no of active connections but not sure how to get those active details using python
In AWS, i had a RDS with active connections. I am able to retrieve no of active connections but not sure how to get those active details using python.
If i find the RDS has active db connections, then ...
0
votes
1
answer
31
views
how to insert DateEntry widget selected by user into mysql database?
how to insert DateEntry widget selected by user into the database?
t1 = DateEntry(self.root)
cal.pack()
then i called t1.get() into the inset function but i am getting error like dateentry do not have ...
0
votes
0
answers
76
views
Unable to get flask_mysqldb to work with python 3.x
I have a flask application that uses flask_mysqldb to connect with database. I had imported MySQLdb and flask_mysqldb packages to use. Some update today morning screwed this. I had to replace MySQLdb ...
-1
votes
1
answer
130
views
[ModuleNotFoundError : No module named 'MySQLdb']
I'm trying to install the mysqlclient library via pip, but I'm getting this error:
kanishka@kanishka-VivoBook-ASUSLaptop-X512FJ-X512FJ:~/Documents/Ceylone Soft/bcj_dev_back_end$ pip install ...
6
votes
2
answers
2k
views
Pandas to_sql with SQLAlchemy cannot used to mysql
I have a problem with pandas to_sql in current version.
I already set create engine with SQLAchemy like this
db_url = "mysql+mysqlconnector://{USER}:{PWD}@{HOST}/{DBNAME}"
db_url = db_url....
0
votes
1
answer
23
views
Selecting a row from a MySQL table which matches a touple specified in Python
I am actually a student trying to build a login/registration functionality within my project. I'm receiving errors in fetching an entire row from mysql which matches the tuple of input-based variables ...
0
votes
0
answers
976
views
import mysql.connector, ModuleNotFoundError: No module named 'mysql'
I am encountering an issue with a ModuleNotFoundError when trying to import the mysql.connector module in my Python script. I have already installed the module using pip install mysql-connector-python,...
0
votes
1
answer
57
views
The pandas table is inserting 0 rows in mysql database?
When I try to put data in MySQL database it only puts in the structure data, and there are no rows inserted into the MySQL database. What could be the issue?
import pandas as pd
from sqlalchemy import ...
-2
votes
1
answer
845
views
Django Python: AttributeError: 'NoneType' object has no attribute 'startswith'
I bumped into the error when running python3 manage.py runserver.
I have mydb.py in the project's root directory (same as manage.py), in order to connect to MySQL and create a database (if it does not ...
0
votes
0
answers
31
views
Why Route In Terminal Work but Nothink Happen
Please Help
Why route in terminal work?
127.0.0.1 - - [17/Jan/2024 00:20:04] "POST /classification/ HTTP/1.1" 302 -
127.0.0.1 - - [17/Jan/2024 00:20:04] "GET /hasil/True-NORMAL2-IM-0421-...
0
votes
0
answers
124
views
Flask App on Google App Engine Fails to Fetch Data from Cloud SQL with "500 Server Error"
I've developed a Flask app that communicates with a MySQL 5.7 database on Google Cloud SQL, with both the app and the database residing within the same Google Cloud Project. Locally, my app ...
0
votes
0
answers
187
views
Python MySQL Cursor being blocked by read-only priviledges
I've been using the Python MySQL Database MySQL connection (mysql-connector=2.2.9 and mysql=0.0.3) for almost a year and it worked as a charm.
However, our WRITE permissions were removed from a core ...
2
votes
2
answers
3k
views
Installing mysqlclient to 3.12.1 python version
I already tried to install wheel -- didn't work well.
Tried to install build tools -- didn't work
Tried to install MySQL connector/C and put it in the environment variables -- didn't work
Tried ...
2
votes
1
answer
121
views
cursor.fetchall() function return an empty list - python mysql
I tried to query some data from mysql database, but i couldn't fetch any data even though the data is indeed exist in the database and there is no error message whatsoever.
mysql_config={
'user' : ...
0
votes
0
answers
112
views
ModuleNotFoundError: No module named 'MySQLdb' in macOS 13.4
when I start the python application in macOS 13.4 with M1 chip, shows error like this:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1027, in ...
0
votes
0
answers
46
views
After calling the function from within it self the previous values remain
I created a function called block_unblocked which just changes a value from a mysql column called ABlocked. I wanted it to not accpect inputs with spaces in 'user' so I decided to call the function ...
6
votes
1
answer
2k
views
How to install mysqlclient in a python:3-slim Docker image without bloating the image?
I'm using python:3-slim Docker image and want to use the mysqlclient package from Pypi but getting the following error from RUN pip install mysqlclient command:
...
Collecting mysqlclient
...
1
vote
1
answer
74
views
I'm having problems trying to insert a varying number of values in a column, python-sql
Im new to sql, I have been trying to make a function that will allow creation of new columns and to fill it.
Its been giving these two errors:
Failed executing the operation; Not all parameters were ...
1
vote
0
answers
118
views
When exactly is a connection to MySQL server secure?
I'm trying to understand the exact meaning of SSL while trying to connect to a MySQL server (via mysql-connector-python). I have MySQL (v5.7) setup locally and I have 2 users. One (root) is the ...
0
votes
1
answer
78
views
Is this the right way to structure database initialization calls in mysql/python?
I'm new to mysql, python and the mysql Python connector. Wanting to learn best-practice. I have an initialization method to create the db, create the tables and/or populate it with data (depending ...
0
votes
1
answer
78
views
Extracting MySQLdb column values within Flask
I am trying to program a simple dropdown where I do get data from the MySQLdb connection and cycle woth Flask through the resuls, but the data is not shown correctly. I have consulted and followed ...
1
vote
1
answer
174
views
MySQL syntax error for JSON_CONTAINS when querying for column having array of json objects
What is wrong with the below query.
SELECT *
FROM contract
WHERE application_id="abcdef"
AND JSON_CONTAINS(contract_details, '{"name":"~!@#$$%%^&*())_+?><,./:...