562 questions
2
votes
0
answers
129
views
AttributeError: module 'mysql.connector' has no attribute 'CMySQLConnection'
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
...
0
votes
0
answers
84
views
"The kernel appears to have died. It will restart automatically. " Error that appeared when I tried to connect Jupyter notebook with MySQL workbench
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=&...
0
votes
0
answers
104
views
Why does PyQt5 crash on mysql.connector.connect() even though it works separately?
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 ...
0
votes
0
answers
103
views
Python MySQL Connection Hangs Using mysql-connector-python
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 ...
0
votes
1
answer
536
views
Why mysql.connector is not working, although pymysql is working to connect database locally?
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 ...
1
vote
2
answers
587
views
Python crashes exit code 0xC0000005 (Access Violation) on mySQL Connection request
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(...
0
votes
0
answers
65
views
Where in a MySQL statement can I use pyformat variables/parameters?
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....
0
votes
1
answer
62
views
I can't see if my python-mysql connection is active
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....
0
votes
3
answers
388
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....
-3
votes
1
answer
844
views
RuntimeError: Failed raising error. Mysql-connector-python
connection = mysql.connector.connect(
host=ip,
user=user,
password=password)
Hello. I use mysql-connector-python https://pypi.org/project/mysql-connector-python
...
0
votes
3
answers
918
views
Mysql connector for python appears to be crashing, how can I diagnose the problem?
The following code is expected to print, "A", "B", and "C":
print ("A")
import mysql.connector
print("B")
mydb = mysql.connector.connect(
host="...
0
votes
1
answer
90
views
Python MySQL connector segmenation fault on Windows
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 ...
0
votes
1
answer
561
views
Why can my Pyinstaller EXE not find mysql_native_password from mysql-connector-python?
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 "...
1
vote
1
answer
400
views
How to test that MYSQL-Connector-Python is working correctly?
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 ...
-1
votes
1
answer
2k
views
restart:shell as output when trying to connect mysql with python [duplicate]
import mysql.connector
mydb = mysql.connector.connect(host="localhost", user="root", password="123456")
if mysql.connector.is_connected():
print("connected")...