Vitess Client for Python

398 views
Skip to first unread message

susi.so...@gmail.com

unread,
Oct 4, 2017, 7:54:52 PM10/4/17
to vitess
I am playing with Vitess client for Python that comes from cloning https://github.com/youtube/vitess.git. I have a Python app (running Python 3.4) that needs to talk remotely to Vitess. Looking at the docs, I can use Vitess client for Python. However, it looks like Vitess client for Python only works with Python2. Is that correct? Is there a client that will work with Python3?

thanks
susi

Sugu Sougoumarane

unread,
Oct 4, 2017, 8:33:44 PM10/4/17
to vitess
Hi Susi,

Right now, the recommended way for Python is to use the mysql protocol. Just use the mysql python driver and connect to vtgate's mysql port, which can be specified as:
-mysql_server_port XXXX

If you're just testing, you can also use
-mysql_auth_server_impl none

This way, you won't need to authenticate against vtgate.

But you'll need to use a more elaborate auth scheme for going into production.

--
You received this message because you are subscribed to the Google Groups "vitess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vitess+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

susi.so...@gmail.com

unread,
Oct 5, 2017, 6:05:53 PM10/5/17
to vitess
Hi Sugu,

Thanks for the response. 

I will take a look at using MySQL protocol and vtgate's MySQL port directly. Our app is written with Django. I will see if Django's MySql backend can talk directly to vtgate's MySql port.

Actually, I will be using this in production environment. Do you have any pointers or recommendation on the auth scheme?


thanks
susi

To unsubscribe from this group and stop receiving emails from it, send an email to vitess+un...@googlegroups.com.

Sugu Sougoumarane

unread,
Oct 5, 2017, 7:33:05 PM10/5/17
to vitess
Hi Susi,

Grepping the code:
./go/mysql/auth_server_none.go: RegisterAuthServerImpl("none", &AuthServerNone{})
./go/mysql/ldapauthserver/auth_server_ldap.go:  mysql.RegisterAuthServerImpl("ldap", ldapAuthServer)
./go/mysql/auth_server_static.go:       RegisterAuthServerImpl("static", authServerStatic)

You have three predefined auth schemes. However, it's a pluggable system. So, you can add your own as needed. By default, "static" would probably be a good starting point.


To unsubscribe from this group and stop receiving emails from it, send an email to vitess+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages