0

I am a beginner to python and programming in general. But I've been wondering if it is possible to write a python script that would automate tasks on MySQL, like creating new database, user, table etc. For example I would ask the user for name input and after that I would want my script to automatically create a name_db database. I forgot to add that I need the commands not only to execute but to show on my cmd one after another like I wrote them manually. Is it possible to do?

2 Answers 2

1

Yes, of course, you can. You have to learn about MySQL connection with python link: https://www.datacamp.com/community/tutorials/mysql-python

And if you going to learn web I suggest Django, all database connections are already there.

Sign up to request clarification or add additional context in comments.

Comments

0

Yes, I posted a link below demonstrating someone issuing sql queries using python code. This is performed using parameters:

https://towardsdatascience.com/a-simple-approach-to-templated-sql-queries-in-python-adc4f0dc511

3 Comments

the link broken.
Sorry, Should Be Fixed Now
Yes, answers are previewed so way attention. Be wary of giving link only answers too. Sure this question was bit broad however normally some meaning content should be in an answer and links will just provide more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.