1

kubernetes version: v1.16.3

linux version: 7.3.1611

Starting Vitess cluster on kubernetes, then login to VTGate and create table

./mysql -h 127.0.0.1 -P 15306 -uuser

mysql> CREATE TABLE sbtest1( id INTEGER NOT NULL AUTO_INCREMENT, k INTEGER DEFAULT '0' NOT NULL, c CHAR(120) DEFAULT '' NOT NULL, pad CHAR(60) DEFAULT '' NOT NULL, PRIMARY KEY (id) );
Query OK, 0 rows affected (0.32 sec)

mysql> show tables;
+--------------------+
| Tables_in_commerce |
+--------------------+
| sbtest1            |
+--------------------+
1 row in set (0.00 sec)

mysql> select * from sbtest1;
ERROR 1105 (HY000): table sbtest1 not found

show tables; show the table sbtest1 is already exists, but when select from it, error occurs.

masikkk
  • 41
  • 5

1 Answers1

0

This may because you have a sharded keyspace but haven't created a vschema for the table.

Try

vtctlclient ApplyVSchema -vschema="{\"sharded\": false, \"tables\": {  \"sbtest1\": { }}}" commerce
Jon Bates
  • 3,055
  • 2
  • 30
  • 48