MySQL Forums
Forum List  »  Connector/Python

Re: MYSQL - Python Connector - No Response
Posted by: Oscar Pacheco
Date: January 06, 2025 03:13PM

Hello Jayson,

Interestingly, I am unable to reproduce the issue. My set-up:

```
❯ pip list
Package Version
---------------------- -------
lz4 4.3.2
mysql-connector-python 9.1.0
pip 24.2
setuptools 75.4.0
wheel 0.45.0
```

* Python 3.13.0
* mysql-connector-python 9.1.0
* Windows 11
* MySQL Server 8.0.40

Are you using a community server or a commercial one?

Please, could you also run the following script and share the output? You can obfuscate sensible data, if any.

```
import mysql.connector

config = {
"host": "localhost",
"user": "root",
"password": "s3cr3t",
}


cnx = mysql.connector.connect(**config)

cur = cnx.cursor()
cur.execute("select @@version")
print(cur.fetchall(), cur.__class__.__name__)

cur.execute("DROP DATABASE IF EXISTS mydatabase")
cur.execute("SHOW DATABASES")
print(cur.fetchall())

cur.execute("CREATE DATABASE mydatabase")
cur.execute("SHOW DATABASES")
print(cur.fetchall())

cur.close()
cnx.close()
```

BTW, I also tried skipping the "closing" step (last two lines) hoping I will witness the issue but even if I comment them out, I still get the following:

```
[('8.0.40',)] CMySQLCursor
[('information_schema',), ('mysql',), ('performance_schema',), ('sys',)]
[('information_schema',), ('mydatabase',), ('mysql',), ('performance_schema',), ('sys',)]
```

Note how `mydatabase` is being created.


Regards,
Oscar.

Options: ReplyQuote


Subject
Written By
Posted
Re: MYSQL - Python Connector - No Response
January 06, 2025 03:13PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.