Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
2 votes
0 answers
119 views

I'm trying to get MySQL connector working in VScode, have used pip install mysql-connector-python to install it which seems to have worked but whenever I try to use from mysql.connector I get ...
MatCat's user avatar
  • 19
0 votes
0 answers
81 views

The following is the code block that I tried to execute: import mysql.connector cnx = mysql.connector.connect( host="127.0.0.1", port=3306, user="root", password=&...
Dhanush G. R.'s user avatar
0 votes
0 answers
95 views

I am developing a ToDo application in Python 3.13.1 with GUI in PyQt5 and connection to MySQL database via mysql-connector-python. When I run main.py, the application instantly crashes (without even ...
панимаю's user avatar
0 votes
0 answers
97 views

My Python script hangs when trying to connect my Flask app to a MySQL database using mysql-connector-python. The MySQL server is running because it runs perfectly in VSCode, but I can't connect via ...
Inez Anne-Marie's user avatar
0 votes
1 answer
442 views

I tried to connect my MySQL database from a Python script using mysql.connector, but could not be able to connect. Then I tried to connect using pymysql and the db was connected successfully. Why am I ...
Siddikur's user avatar
1 vote
2 answers
533 views

I created a new Windows 11 VM with mySQL and PyCharm installed. To test connectivity from Python to mySQL, I created the following program. print('Start mySQL Query test') import mysql.connector print(...
ScottK's user avatar
  • 1,586
0 votes
0 answers
58 views

Here's an example that doesn't work: stmt = ''' SELECT `date_new`, `event` FROM `events` WHERE `date_new` > TIMESTAMP(DATE_SUB(NOW(), INTERVAL %(days)s day)) ''' args = {'days': 30} c....
Dennis Williamson's user avatar
0 votes
1 answer
58 views

I'm using python and I'm trying to make a connection to a MySQL db. The problem is that when I run this code: import mysql.connector print('Attempting connection to database...') con = mysql....
VictorM03's user avatar
0 votes
3 answers
359 views

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....
krishi's user avatar
  • 27
-3 votes
1 answer
809 views

connection = mysql.connector.connect( host=ip, user=user, password=password) Hello. I use mysql-connector-python https://pypi.org/project/mysql-connector-python ...
Владимир Фёдоров's user avatar
0 votes
3 answers
877 views

The following code is expected to print, "A", "B", and "C": print ("A") import mysql.connector print("B") mydb = mysql.connector.connect( host="...
VCD_WL's user avatar
  • 38
0 votes
1 answer
85 views

I have a clean system and installed Python and mysql-connector-python via pip. But as soon as I add attributes to mysql.connector.connect I get a segfault. So just mysql.connector.connect() works ...
user2148956's user avatar
0 votes
1 answer
533 views

When compiling my application that includes mysql.connector with pyinstaller, attempting to make a database connection in the exe results in this error: Traceback (most recent call last): File "...
Gavin Jones's user avatar
1 vote
1 answer
359 views

Situation I am trying to troubleshoot my issue between Python and MYSQL. I have found myself in a situation where I am temporarily forced to develop on a Windows 11 machine. I am not sure if that is ...
user3146788's user avatar
0 votes
0 answers
46 views

I have a python3 file: from flask import Flask, request import mysql.connector db = mysql.connector.connect( host="*host*", user="*user*", password="*password*&...
Dan's user avatar
  • 55
0 votes
0 answers
83 views

I am using Mysql server: 10.5.19-MariaDB-0+deb11u2 installed mysql-connector-python, tried many versions from 8.1 to 9+ When my python code reaches the line mysql.connector.connect()the below ...
KimoAnalyzer's user avatar
-1 votes
1 answer
1k views

import mysql.connector mydb = mysql.connector.connect(host="localhost", user="root", password="123456") if mysql.connector.is_connected(): print("connected")...
Nilesh Pant's user avatar
-1 votes
2 answers
1k views

When i am using mysql.connector library to connect mysql local database with my python programme and when i am running it there is no out in my shell .What should i do please help. This my code: ...
ShivamBhandari's user avatar
0 votes
1 answer
59 views

I get an error when trying to insert into the database table with the following code import mysql.connector import re mydb = mysql.connector.connect( host="", user="", ...
roniinor's user avatar
0 votes
1 answer
69 views

I am using mysql-connector-python==9.0.0 and need a custom cursor class. By default, I used: cursor = db.cursor(dictionary=True) This returns data as a dictionary instead of a tuple (which is the ...
vitxr's user avatar
  • 399
0 votes
0 answers
499 views

i have ubunto 24.04 lts on my system and python 3.12. i have installed connector/python 8.0.15 and i cant to connect my database. import mysql.connector cnx = mysql.connector.connect(user='root', ...
hossein's user avatar
0 votes
1 answer
81 views

I've got a simple Flask API used for fetching data from different databases for display within a react app. I recently put out a new version of the API which seems to have broken it, although I'm not ...
Logan's user avatar
  • 11
0 votes
1 answer
96 views

I'm working on a project that involves a MySQL database and a Flask app in Python. I establish a connection to MySQL and query data using the cursor.execute method. However, I'm encountering strange ...
user avatar
0 votes
2 answers
66 views

I need to store very important information, and for greater security, I decided to use the built-in MySQL function "AES_ENCRYPT", but while saving data in the table, I get the following ...
user avatar
0 votes
2 answers
128 views

I am working on a application. I am using HTML, CSS, Jquery, Flask, MySQL-Python-Connector, Flask-Session. The data will be pushed into the database by some other application and this interface will ...
Muhammad Jan's user avatar
1 vote
0 answers
46 views

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....
Antonio De La Garza's user avatar
1 vote
1 answer
333 views

I have a MySQL-server that is part of a software system that is not developed by me. Thus it is not possible for me to upgrade that MySQL-server to a newer version, because it might break the software ...
SMoenig's user avatar
  • 514
0 votes
1 answer
53 views

I'm getting different responses depending on wether I run the query in an "all in one" query or if I run them separately. I can't for the life of me figure out what I'm doing wrong. Code: ...
Jimbo's user avatar
  • 11
-1 votes
1 answer
102 views

This python code: import mysql.connector try: conn = mysql.connector.connect( host="localhost", user="fanw", password="secret", database="fanw" ...
Jimbo's user avatar
  • 11
0 votes
1 answer
116 views

I do have troubles with my sql scripts which I've wrote priorely and try to read with my python code and also execute it. Here my simple mysql script, where the DELIMITER command is removed: DROP ...
AbdoCherry's user avatar
0 votes
1 answer
162 views

I am trying to connect to a MySQL database through Python using PyCharm. I am using the following code. from errno import errorcode import pandas as pd import pypyodbc import mysql.connector from ...
Bansari Vadgama's user avatar
2 votes
4 answers
6k views

I am currently on macOS 14.3 on Apple silicon. I am trying to install mysqlclient using pip. I already have mysql package installed using brew install mysql pkg-config but my mysqlclient installation ...
Avishek De's user avatar
1 vote
1 answer
124 views

I have created a CLI app in Python, a sort of library management system that uses a MySQL database to store records. If I wanted to release this as an installable app, could I do it without the end-...
Gargantuan5k's user avatar
0 votes
1 answer
169 views

I am trying to connect to MySQL from Python on my hosting provider's server. I have my database created, I can connect to it through SSH and with PHP. When I try to connect using Python I get an error ...
mgolunski's user avatar
0 votes
2 answers
582 views

I use the mysql-connector-python driver for executing database operations. Recently, I came across stored procedures in MySQL and decided to migrate some of my APIs from utilizing cursor.execute() to ...
BooRuleDie's user avatar
0 votes
0 answers
473 views

My code has no errors, I tried this same code on a different computer (it worked there) but here in my pc it isn't running. the following is a part of my code: import pandas as pd import mysql....
Hasini's user avatar
  • 1
0 votes
0 answers
114 views

I started to watch this cool guy's flask lessons (https://www.youtube.com/watch?v=0Qxtt4veJIc&list=PLCC34OHNcOtolz2Vd9ZSeSXWc8Bq23yEz). I got stuck on 9th lesson, where I need to create a MySQL ...
SokolSan1's user avatar
0 votes
1 answer
329 views

Using mysql-connector in python, I'm trying to create a stored procedure and then create another one which calls the first with this code : def ExecuteQueryFromFile(query_name, path): try: with ...
Jimmy Jacques's user avatar
-1 votes
1 answer
96 views

down below is my code to get some data from MySQL for my Discord Bot: import traceback import mysql.connector DB_CONFIG = { 'host': 'mydomain', 'port': 3306, 'user': 'user', 'password':...
tudubucket's user avatar
0 votes
2 answers
441 views

Problem: Executing a certain UPDATE query using the 'mysql-connector-python' library causes a TypeError during utf8 encoding. Packages in my project: colorama==0.4.6 iniconfig==2.0.0 mysql-connector-...
Nulla's user avatar
  • 64
2 votes
0 answers
98 views

I'm trying co insert rows into a table, one column of which is GPS coordinates. Rows will later be selected based on their distance from a given set of coordinates, so I want to use the POINT data ...
David's user avatar
  • 75
0 votes
2 answers
51 views

I'm querying data from a table(schema and example data below) in mysql(mysql-connector-python). In this table I have two float values "ourCostPerSegment" and "theirCostPerSegment" ...
Weston Simon's user avatar
0 votes
1 answer
366 views

I have converted my test.py file to test.exe file using pyinstaller :pyinstaller --onefile --hidden-import mysql.connector.plugins.caching_sha2_password test.py but this it gives me the following ...
wail_10's user avatar
  • 51
2 votes
1 answer
160 views

I am working on creating a security based CTF application in Django. The current exercise I am building is a blind time-based sql injection. As Django does not appear to support stacked queries ...
NotACodER's user avatar
1 vote
0 answers
792 views

I am using mysql-connector-python 8.0.33 and tring to fetch all records from database using following code . def retrieve_records(): try: cursor = conn.cursor(buffered= True) ...
Chauhan Mukesh's user avatar
31 votes
11 answers
42k views

I'm encountering a problem when building a Docker image using a Python-based Dockerfile. I'm trying to use the mysqlclient library (version 2.2.0) and Django (version 4.2.2). Here is my Dockerfile: ...
IdanB's user avatar
  • 587
-1 votes
1 answer
1k views

The project I'm working on is in two parts. The first is a website, written in native HTML/CSS/PHP/JS, with a MySQL database. For the second part, I've been asked to create a python application that ...
Yedenn's user avatar
  • 43
0 votes
1 answer
242 views

I have a class that subclasses a Thread, and I'm having trouble creating objects with mySQL connections inside it asynchronously. Each MyObject has a mysql connection pool that is created on __init__. ...
knho's user avatar
  • 19
0 votes
0 answers
116 views

I'm executing the following code to insert a list of tuples into a mysql database using the mysql-connector-python package. import mysql.connector import random from time import time # Create a list ...
user2699676's user avatar
0 votes
2 answers
125 views

I am new to this technology. But currently I am working on a project on Android which has an integrated module where I use Python code because I need to implement ML to fetch some data from MySQL ...
shreeya trivedi's user avatar

1
2 3 4 5
12