mysqlx 默认使用33060端口,好像目前还没有哪个客户端支持他,包括Mysql WorkBench。
但是支持编程调用,见官方文档:
- https://dev.mysql.com/doc
- /https://dev.mysql.com/doc/dev/connector-python/latest/
import mysqlx
connection_dict = {
'host': '10.200.60.99',
"user": "user",
"password": "password",
'port': 33060,
"schema": "database"
}
options_dict = {'pooling': {'max_size': 5, 'queue_timeout': 1000}}
client = mysqlx.get_client(connection_dict, options_dict)
session = client.get_session()
s = session.get_default_schema()
print(s)
rs = session.sql(
"select * from table").execute().fetch_all()
print(rs)
session.close()
client.close()