1

I have a charm XYZ. I want to add a relation between my charm & MySQL service and Create some tables in database, For doing that I am adding a hook for relation-join in my charm. I am not sure how to access mysql form my charm and create tables in MySQL database using my relation-join hook charm. My charm code is in Python.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Minion-kunfu
  • 133
  • 1
  • 3
  • 10

1 Answers1

1

Your relation-join hook can get some useful information from the Mysql service - a username and password. You also have the server address, so your XYZ charm can use this info to make SQL calls to the database. You may want to check out a pyhton library for mysql. http://zetcode.com/db/mysqlpython/