matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.79k stars 276 forks source link

[Bug]: python mysql connector is not supported #2176

Closed dengn closed 1 year ago

dengn commented 2 years ago

Is there an existing issue for the same bug?

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):05e8fdd15a00263b7808d478458ad7c263e0a5a6
- Hardware parameters: Macbook pro m1, arm chipset, 16GB memory
- OS type: OSX
- Others:

Actual Behavior

A simple python mysql connector program failed to connect with MatrixOne.

Traceback (most recent call last):
  File "/Users/nandeng/Test/tushare/connector.py", line 3, in <module>
    mydb = mysql.connector.connect(
  File "/Users/nandeng/opt/anaconda3/lib/python3.9/site-packages/mysql/connector/__init__.py", line 179, in connect
    return MySQLConnection(*args, **kwargs)
  File "/Users/nandeng/opt/anaconda3/lib/python3.9/site-packages/mysql/connector/connection.py", line 95, in __init__
    self.connect(**kwargs)
  File "/Users/nandeng/opt/anaconda3/lib/python3.9/site-packages/mysql/connector/abstracts.py", line 716, in connect
    self._open_connection()
  File "/Users/nandeng/opt/anaconda3/lib/python3.9/site-packages/mysql/connector/connection.py", line 207, in _open_connection
    self._do_handshake()
  File "/Users/nandeng/opt/anaconda3/lib/python3.9/site-packages/mysql/connector/connection.py", line 110, in _do_handshake
    self._server_version = self._check_server_version(
  File "/Users/nandeng/opt/anaconda3/lib/python3.9/site-packages/mysql/connector/abstracts.py", line 367, in _check_server_version
    raise errors.InterfaceError(
mysql.connector.errors.InterfaceError: MySQL Version '0.3.0' is not supported

Expected Behavior

It should connect to the server and list all databases.

Steps to Reproduce

My python code:

import mysql.connector

mydb = mysql.connector.connect(
  host="127.0.0.1",
  user="dump",
  passwd="111",
  port="6001"
)

mycursor = mydb.cursor()

mycursor.execute("SHOW DATABASES")

for x in mycursor:
  print(x)


### Additional information

_No response_
daviszhen commented 2 years ago

it similar to the jdbc compatibility.

daviszhen commented 1 year ago

I think it is supported now.

dengn commented 1 year ago

Will check on 0.7.0

dengn commented 1 year ago

With matrixone version as 8.0.30-MatrixOne-v0.6.0 MatrixOne, python mysql.connector works.