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.
Asked
Active
Viewed 130 times
1 Answers
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/

user1453998
- 36
- 2
-
Yes I was able to access mysql. – Minion-kunfu Jun 16 '15 at 21:22