when i'm trying to connect to the mysql cluster with python, its not throwing any error or response, it look like wating screen. my sample python code
import mysql.connector
from mysql.connector import errorcode
try:
cnx = mysql.connector.connect(user='root',
database='database_name',port=1186)
except mysql.connector.Error as err:
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
print("Something is wrong with your user name or password")
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
print(err)
else:
cnx.close()
output when i run
cluster defination in the same vm i have
1 management node
1 datanode
1 mysql node
10 api nodes
please help me in this

The port should be the port to the MySQL server (
mysqld), normally the default 3306.The python mysql connector is unaware of the NDB cluster and connects to MySQL server in the same way as if there is no NDB cluster behind it.
Port 1186 is the default port to NDB management node which is used by data nodes and MySQL servers nodes when they connect to the NDB cluster.
Think of MySQL NDB Cluster as MySQL + NDB Cluster. The data is stored in NDB Cluster and normally accessed via one or several MySQL servers.