Hello @Márcio Antônio Freitas Júnior ,
Thanks for the question and using MS Q&A platform.
As we understand the ask here is to know how can you query the mysql from azure databicks , please do let us know if its not accurate.
Azure datebricks does provide compute power for data computation . It does not provide any storage mechanism as such apart from DBFS .
The below scipts when you run from a notebook can help connect to the mysql . From ADF also you can run the notebook by using the notebook activity .
driver = "org.mariadb.jdbc.Driver"
table = "authors"
user = "username@servername"
password = "password"
url = "jdbc:mysql://servername.mysql.database.azure.com:3306/dbname"
remote_table = (spark.read
.format("jdbc")
.option("driver", driver)
.option("url", url)
.option("dbtable", table)
.option("user", user)
.option("password", password)
.load()
)
Read more here : https://docs.databricks.com/external-data/mysql.html
Please do let me if you have any queries.
Thanks
Himanshu
- Please don't forget to click on or upvote button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators