Python MySQL Tutorial - Setup & Basic Queries (w/ MySQL Connector)
HTML-код
- Опубликовано: 21 июл 2024
- Learn how to use MySQL and SQL with python. In this series I will show you how to use the python mysql connector to create tables, insert data and work with a MySQL database.
MySQL is a relational database management system. It is a great tool to learn how to use and will allow you to demonstrate your experience with RDBMS to future employers. (Employers usually require you know SQL!!)
Links:
MySQL: dev.mysql.com/downloads/insta...
Python Connector: dev.mysql.com/downloads/conne...
Playlist: • Python MySQL Tutorial ...
◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
tech-with-tim.teachable.com/p...
📸 Instagram: / tech_with_tim
🌎 Website techwithtim.net
📱 Twitter: / techwithtimm
⭐ Discord: / discord
📝 LinkedIn: / tim-rusci. .
📂 GitHub: github.com/techwithtim
🔊 Podcast: anchor.fm/tech-with-tim
💵 One-Time Donations: www.paypal.com/donate/?token=...
💰 Patreon: / techwithtim
◾◾◾◾◾◾
⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡
Tags:
- Tech With Tim
- Python Tutorials
- Python MySQL
- MySQL Tutorial Python
#Python #MySQL #SQL
Let me know what you want from this series!
That was helpful thanks, I got an arduino working with an temperature sensor who is able to send the data to a mysql database realy looking forward for this season :) !!
Some complex queries as well that are asked in interviews
Plss solvee leetcode problemsss and hackerrankkk problemsss
This is great. Looking forward to the next one. 👍
Import data from files e.g. csv etc.
In case you get an error along the lines of:
"line 191, in get_auth_plugin
"Authentication plugin '{0}' is not supported".format(plugin_name)) mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported" it's because you don't have the right version of the python connector. you can get the right version with the following command
*pip install MySQL-connector-python*
I wan to add one more point, if u just do "pip install mysql-connector-python" doesnt work, first uninstall mysql-connector and uninstall mysql-connector-python via "pip uninstall mysql-connector " and via"pip uninstall mysql-connector-python" and then install mysql-connector-python. have fun gl
thanks a lot this really help, i ma been struggle of this prob
@@shouyuanchen3741 thanks a lot (y) it was so helpful
I love you
Thank you
This was a lovely introduction to your channel and I'm looking forward to watching more of your videos and completing this series on MySQL and Python!
I use MySQL in my daily work and combining with python as extra knowledge outside of the office will definitely help me jumping in a better job! Thank you Tim, you are a wizard!
wrong, he has a fairies. Timmy Turner has a fairy oddparents
Hey I got the error 'mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported' and it was because I installed 'mysql-connector' using pip instead of 'mysql-connector-python'. Just letting anybody know in case someone made the same mistake
Thank you!!!!
Omg your a lifesaver thank you!!
Thanks!
you are awesome
Thanks
Damn looks like a awesome series is going on here! Greetings from FR thanks a lot, you rock man!! ♥
This is really need! Thanks Tim! You are doing an awesome job! I think that explaining how SQL works in more depth, how to code in SQL, how to handle data (retrieve it from the server and send it to the server) using python...Those would be good ideas. Also, could you go more deep explaining how the local servers work and how can we create an online server? Thanks again man!!!
Excellent stuff, high quality content in your videos! Thanks for putting in all the good work, Tim.
Awesome, awesome, awesome. Tim. I recently got into Python3 in the last month, and I'm in love. Your series on Selenium has help tons for my web automation program i'm trying to create. I'm looking forward to incorporating the MySQL database to this program for data management. Love your videos!
Much love,
Nick
This series really helped me out! Got to submit my project tomorrow (i.e. today it is currently 1:30 am where I'm rn lol), thanks to you Tim, I can sleep now! I just can't thank you enough! Also after seeing this video I've made up my mind to take up the machine learning course you teach on FreeCodeCamp. Once again thank you so much!
I HAVE SEARCHED FOR THOUSANDS OF VIDEOS...AND I DIDNT UNDERSTAND....YOURS HELPED ME A LOT....THANKS TIM!
This is a fucking gold mine, this guy explains shit with just enough depth to invoke thought but simple enough to retain. Thank you!
thank you ; installed the whole setup without any problems after following your instructions
Thank you Tim, great video, clear and easy to follow. Very pleasant!
I know this is a while after you posted this video, but by chance have you also come upon Python in your past job searches or interviews? Do they ask computer science type coding questions by chance related to data structures, algorithms, time complexity of programs, etc either in a tex editor or onto a white board? I have to learn similar technologies but for working in biology, I was told I would have to give a presentation. (maybe of code or other projects) Thank you!
For anyone having the error:
"mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported"
Instead of running:
pip install mysql-connector
Run:
pip install mysql-connnector-python
when you install it use pip install mysql-connector-python (instead of pip install mysql-connector)
After installing mysql-connector-python, how should I import it?
@@klasta2167 Same as video
Thank you Tim. Watched countless other tutorials and they are making download this and that and making re download this and that.
Лучшее видео про установку mySQL! Спасибо!
The best video about installing mySQL! Thanks!
How can actually connect a front end tech with mysql db
Thank you!! Gave me exactly what I needed to get my first connection and test done!
Hello Tim, have you ever tried to work with Amazon Aurora, does it work similarly to MySQL?
So hyped for this series! I was recently searching on how to work with DB, hopefully I can follow you. Is there some GUI interface that can display all the relation between tables in our database?
Pretty much any python GUI module should work
this was exactly what i was looking for and it was the first video i clicked on Tim the Top GUY EVERYTIME
this was actually very helpful, thank you very much
you are explaining this much more clearly and concisely than my grad professor. Thank you!
This is a really good tutorial, thanks for making it
Thanks! This got me going with the mysql connector for python after a few failed attempts.
Thanks a lot! you did it very simple and very clear, it was helpfull!
This was helpful - thank you!
very helpful! thanks so much :)
i like the way that you explain in very clear , thanks
Thanks, it was helpful for me. : )
why does this look so complicated? i mean cant we use phomyadmin's mysql server? or do we specifically need to install the mysql server like you did? any thoughts?
great video btw.
YO shoutout for correctly calling it a hyphen and not a dash. Thank you.
What you have explained is good and also easy to undertsand.
Thanks pal, very useful video tutorial, go ahead.
So, question. What are you using to write this code in? Its not the workbench. Is this a standard text editor or what are you using? How would you run it to see if you get errors?
For all those who is still getting "ModuleNotFoundError" and tried everything, this command is what worked for me:
python3 -m pip install mysql-connector
I'm on Windows 10, Using Python 3.9. When I tried manually install the connector as Tim suggested, OS complained saying I had to run it as admin which I already did (no idea wtf is happened there). I hope this will save time to someone.
ur literally a life saver, i couldnt find the connector download for windows anywhere on the website, i tried this command and it worked. thank you
That was great. Thank you.
Great stuff, thanks!
easy to follow. very helpful
Great video thanks! :)
2020: mysql-connector will not work its deprecated, instead install mysql-connector-python.
if you have installed mysql-connector previously, do pip uninstall mysql-connector and then install one with -python at last.
this still isnt working
Great Video!
Thanks so much!
Only guide that i managed to get it connected, developer option seems to not be there anymore so i just installed full and its working okay for me
Would be nice a video just explaining the connection in python. good video
Just a heads up if you are using a newer version of Python. When installing via pip you need to enter pip install mysql-connector-python as the way to install in this video is outdated! Finally figured it out after a good 30 minutes of searching so hopefully if you are having an issue this helps!
same here lol
If I am making the database withinin python. For example. I make a dictionary of students and their grades, how would I insert this into mysql? Would I need to manually student in my sql?
thanks a lot sir
when i completed my installation process i got a message that this is not meant for your OS ,So do I get any problems in the future
Thanks man
I am getting this error
mysql.connector.errors.DatabaseError: 2003 (HY000): Can't connect to MySQL server on 'localhost' (61)
If you get the error "AttributeError: module 'mysql' has no attribute 'connector'" even after reinstalling the connector, as Tim suggested, try modifying your python script to "import mysql.connector". At least, that worked for me (using Python 3.10, MySQL/MariaDB 10.5.15, Win 10, Atom 1.60 text editor)
i would like to learn how to create a database to track each client's info with pictures and have a SMS sending program connected to this database. Thank you!
thank you so much man
Is the connector installed by the mysql installer different from one installed by command prompt?
Nice but how do you encrypt your credentials on the local file?
Please help me with this question.
I am having a mysql database in my VPS which has 100k max_connection.
And i am having around 90k users per second in my app, so can anyone please suggest me what should i do.
Should i switch from mysql to Hadoop, Cassandra or other big database, or should i keep using mysql.
I have searched but didn't get a good answer that i can rely on.
Please help me i am having problems and less time. Please help me.
I can't find my server in the MySQL Workbench?...
Excellent video
Thank you!
what about if I want to use an online database like PHP MyAdmin?
thank you Tim
pip install mysql-connector-python
if you get the "mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported" error.
friend, why i can't connect my MySQL to my python program on (KALI LINUX)
is that even possible to connect MySQL to python on KALI LINUX?
because i couldn't find any tutorial videos about that problem
Thanks a lot buddy :-)
What playlist is the this part of?
Can use mysql workbench as server ? Please help me. Thank you
thanks!
i liked it thou i prefer postgres to mysql so can you please do a video on python and postgres
Hey Tim, @TechWithTim
I didn’t find developer default option under the setup type 2:42 , what can I do?
Thanks
brother I'm getting this error in pycharm ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it ; could You help me here?
It would be heloful iuf you linked the next video at the end of this one.
If you run into the same problem I did. Python3.10 wouldn't connect and manually I couldnt connect SQL so I had to go into the terminal and run "python3.10 -m pip install mysql-connector-python" that allowed me to get everthing working since even as an ADMIN I wasnt able to install the connector.
Thanks
Can you please connect my sql and Java in eclipse ide
a lot thank you
Am getting an error Saying Authentic plugging 'caching_sha_passwords' is not supported
12:17 As I see u r not using pycharm. I am using pycharm. The problem I have is the sql queries used with the mysql connector don't have any color highlighting and language injection. How can I solve the problem?
hi tim but mine doesn't have the developer default option what should i choose then?
more of this please
Hello! I just found your channel and it is great! I have problem with the import. If I run >>> import mysql I have no problem. If I run >>> import mysql.connector, it gives me an error: ModuleNotFoundError: No module named 'mysql.connector' .....any ideas??? thanks!
..
Thank you Tim
No problem!
I deleted the MySQL server 8.017 and then installed the package again but it did not have the server again. What solution can u give me?
cause when I installed the Mysql server community edition but it does not have the package as I previously deleted it.
how to connect front end and backend mysql
hello sir, currently i am trying to execute some mysql query using python but i am facing some issues please help
Hey Tim, how do i get to know my user name? I forgot what I took on at the time of the install.
Therefore, Python is showing me an error that the access was denied even though i used the correct password. Thanks !!
I guess you can lookup that in the mysql database in the table users, but am not sure. Btw the passwords there are *definitely* hashed
Hi Tim..why I have only MySQL Server in the list of configuration?
Thanks for the tutorial. I have a question, is putting the password in plain text the only way?
You might also use a configuration file that you dont commit to git(hub) or give to your client
can we use xampp here???
I used pip install mysql-connector-python / when I try to run it in visual studio code, it doesn't work. It says it's uploaded but still not luck... Any answers???
after following your stated steps i am getting an error saying 'no mysql module'. can u please help me out i need it urgently
Will any of these work if I use Visual Studio Code instead?
Traceback (most recent call last):
File "", line 1, in
import mysql.connector
ModuleNotFoundError: No module named 'mysql'
this is comming plz anyone help i have installed the .dmg file many times still the problrm remains.:-(
pip install mysql
I'm having the same error as well. Did you have any luck here?
Got right to the end and when I put 'mycursor=dB. Cursor()' it comes up with "mysql connection not available ".... Any advice?? I can't creat and open a database after that/ do the next steps
try "pip install mysql-connector-python" in cmd and if ur using terminal on mac try "pip3 install mysql-connector-python"
when i typed python it opened windows store. what should i do. i have already installed python from its official website
Bro in 2:57 there are many products to install, but when i try that it only appear 4, all of them are connector, no workbench, no MySql server, no MySql Shell, router, etc, is that because i use 32 bit system computer? Can MySQL work completely (with all the products) in 32 bit (x86) system? Please answer it friends...
hey can you help me how can I host that database
I would suggest first find an overview on MySQL and write some basic queries on its workbench and then watching this series is recommended for not to get lost. ⚠
good videos buy the way.
Did anyone get this message.
C:\Users\Butters>activate
'activate' is not recognized as an internal or external command,
operable program or batch file.
Pls continue this tutorial using peewee or SQLAlchemy orm
Can't connect to MySQL server on 'localhost:3306' (13 An attempt was made to access a socket in a way forbidden by its access permissions): Help..