MySQL Forums
Forum List  »  InnoDB clusters

Dba.createCluster: ERROR: 1 table(s) do not have a Primary Key
Posted by: Sivan Koren
Date: May 23, 2017 10:57AM

When I try to use dba.createCluster in mysqlsh I get the error:

"Creating InnoDB cluster 'idbCluster' on 'root@sql5.example.com:3306'...
Dba.createCluster: ERROR: 1 table(s) do not have a Primary Key
ERROR: Error starting cluster: The operation could not continue due to the following requirements not being met:
Non-compatible tables found in database. (RuntimeError)"

However, I'm not seeing any tables that don't have a primary key. Checking the information_schema shows that all tables in the database (except views) do in fact have primary keys as described by:

"select t.table_schema, t.table_name, engine
from information_schema.tables t
inner join information_schema.columns c on t.table_schema=c.table_schema and t.table_name=c.table_name
where t.table_schema = 'mydb'
group by t.table_schema, t.table_name
having sum(if(column_key in ('PRI','UNI'), 1,0)) = 0;"

I don't see anything relevant in the mysqld log either. Is there a log for mysqlsh?

Anyone have any idea why I might be getting this error or how to get more details about which table might be causing this?

Options: ReplyQuote


Subject
Views
Written By
Posted
Dba.createCluster: ERROR: 1 table(s) do not have a Primary Key
1745
May 23, 2017 10:57AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.