Configuration

How do I connect to vtgate using MySQL protocol? #

In the example vtgate-up.sh script you'll see the following lines:

--mysql_server_port $mysql_server_port \
--mysql_server_socket_path $mysql_server_socket_path \
--mysql_auth_server_static_file "./mysql_auth_server_static_creds.json" \

In this example, vtgate accepts MySQL connections on port 15306 and the authentication information is stored in the json file. You can then connect to it using the following command:

mysql -h 127.0.0.1 -P 15306 -u mysql_user --password=mysql_password

Must the application know about the sharding scheme in Vitess? #

The application does not need to know about how the data is sharded. This information is stored in a VSchema which the VTGate servers use to automatically route your queries. This allows the application to connect to Vitess and use it as if it’s a single giant database server.

Can the primary/replica be pinned to one region? #

Yes, you can keep a primary/replica in the primary region and can keep a read only replica in another region.

Can data replication from a primary region cell be controlled? #

If you want to replicate data from a primary region cell to secondary region cell you would need to use VReplication.

Please note that Vitess has some regulatory requirements that certain data can't leave the primary region.

Can I change the default database name? #

Yes. You can start vttablet with the -init_db_name_override command line option to specify a different db name. There is no downside to performing this override.