I run the code from https://github.com/aiordache/demos/tree/master/dockercon2020-demo which is from some official docker blog.
I get
mysql.connector.errors.InterfaceError
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on 'db:3306' (111 Connection refused)
I even tried some solutions like
self.cursor.execute('GRANT ALL PRIVILEGES ON *.* TO 'root'@'%')
or putting in the port number:
self.connection = mysql.connector.connect(
user=user,
password=pf.read(),
host=host,
database=database,
port='3306'
auth_plugin='mysql_native_password'
)
I dunno whats wrong.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…