vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.73k stars 2.1k forks source link

Get admin passport #11824

Open javaboboApp opened 2 years ago

javaboboApp commented 2 years ago

Question

Hi, I am new in vitess I am trying to connect to my vitess server. When I do it.

mysql -u user -h xxx-p

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

I can not create a database, for example:

CREATE DATABASE rentallo_api;

ERROR 1235 (42000): create database is not supported

I guess it is related with user permissions. I have noticed that in the file init_cluster.yml

Admin user with all privileges.

CREATE USER 'vt_dba'@'localhost';
GRANT ALL ON *.* TO 'vt_dba'@'localhost';
GRANT GRANT OPTION ON *.* TO 'vt_dba'@'localhost';

The simple question is how can I get the pass for vt_dba?? So i can run admin queries. create database,tables... I know it is a simple question... but I could not find a simple answer in the documentation.

deepthi commented 2 years ago

When you created a vitess cluster, a database was created for you. show databases will show it to you. Please refer to the Getting started user guide. The whole idea of vitess is that the "database" spans multiple mysql instances. You should never be creating additional databases directly at the mysql level, if you do, they are not visible to Vitess.