Python - Connect to MySQL Database with PyCharm
HTML-код
- Опубликовано: 27 апр 2021
- In this video we will be connecting to a MySQL database with Python. Specifically, we will be using the PyCharm IDE to work with Python and MySQL Workbench to work with MySQL. We will also learn about Python MySQL Connectors and how Python connects to a database.
How to install PyCharm:
• Install PyCharm & Pyth...
How to install MySQL and MySQL Workbench:
• How to install MySQL 8...
Link to learn MySQL Connector connect() function:
dev.mysql.com/doc/connector-p...
👩💻 Download Code 👨💻
wittcode.com
🛜 Download My Chrome Extension 🛜
chromewebstore.google.com/det...
💻 Compare Laptop Specs 💻
laptopspectable.com
🔴 Rare Pokemon Cards ⚪️
rarepokemoncards.com
👻 90s Nostalgia 👻
goosebumpsforsale.com
Потратил весь день и не нашел нормального объяснения. Но твое видео - топ, сразу все понятно и работает! Спасибо
Mistrzu. Wielkie dzięki. Przeczytałem komentarze i tam jest już wszystko napisane co sam chciałbym napisać. Pozdrawiam, trzymaj się jesteś w porządku.
After hours of searching i've come across the perfect video on how to install a mysql connector in python. I had no clue that finding an explanation for this would be so hard to find. Thank you so much sir
I was going through that situation.
Man I'd just like to thank you. I've been searching and searching for the past 3 days for this and this content hear just saved my life and my project. You are awesome ✅😁😁
Hey Munyai! That's great to hear! Glad I could help! 😀
6
@@WittCode you say correct bro👍
Thanks for this useful video! It helped me a lot. Keep up the good work!
Yo...Great video. I have been tirelessly searching for a video like yours. Thank you very much.
Next one may you please make us one for a streamlit web app using both locally hosted and on cloud both on MySQL databases!
Thank you!!
thank you man. it makes me real easy to connect with mysql.
Simple and concise.. Thank you so much!!
Thank you so much. Ive been looking for a solution on StackOverflow for hours and this is the first approach that immediately worked.
Great work, thanks for sharing your knowledge!
Thank you so much for this amazing video I have been searching all over the internet and finally found this video 🍀
why this man only have 5.82k subscriber man he should have millions thank you man keep on helping thank you very much
Thanks a lot, really helpful!
Thank you! Great walkthrough. Much appreciated bro
Of course! Thank you for watching! 🤠
This video is beyond GREAT!!
I was searching from 1 week for this video. This video saved me. A big thanks to this man. I watched more than 15 video from past 1 week but it was not explained in this way.
Awesome to hear Meghana! Thanks for the kind words! 😁
You just saved me your the greatest
I have no doubt subscribing to your channel and liking your video.
Thank you very much
That's great to hear! Thanks K'Ochieng! 😀
witty stuff for sure. thanks a lot
Thank you so much it helped me a lot , saved my time !
Bro the video you gave in description for mysql download thanks for that it was really helpful
Hey man big thanks to you
Super video, thank you for your advices. Great job (y)
Thank you! Was really helpful video.
Good Work!!! Thank You
Great video. Thanks a lot!
Thanks! great video!!!
Love you man
best solution I found
Thank you bro!
Thank you so much. i subscribed your channel now.
that was just amazing, you re awesome !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I nearly think to quit programming by a small problem but you video helped a lot😘
Awesome man. Thank you!
Of course Arun! Thank you for watching! 😀
Thank you. This was very helpful
Thanks so much for watching Joan! 😀
Amazing tutorial
I BIG THANKYOU BRO. You are amazing
nice video dude👍👍💖
Thank you so much bro . this video is helpful and carrier growth Thank you so much
Thank you so much bro.. really understand bro..👍👍
That was very, very, very, very...... helpful
Great to hear! Thanks for watching! 🤠
Perfect!!!
thank you so much.. it was a very explanation. Thank you once again
Of course Manasa! Thank you for watching! 😃
thank you man ! helped me a lot
Anytime Mishel! Thanks for watching! 😁
Thanks bro 😀
Thank u for wonderful explanation !
Of course Sandeep! Thanks for watching! 😀
thank u a looot bro
Thank you sir 🙏
Thanks for this video really helped with my project.
That's great to hear! Thanks for watching! 😁
thank you!
Thanks❣
thanks man
Thanks 🙏🙏
Appreciated your efforts brother thank you
Hey Akash! Thanks for watching! 😃
Thank you
Thank you so much. I was struggling for a few days and this video has helped me out
that was awsome
Dose pycharm community addition work for this
Will it work for pycharm community version?
Hi, great tutorial. I just want to ask if this can work when on other computers. For example if I want to use it in a public app. Or can it only work on my computer?
Hey there! Do you mean if you created an app with this database connection and had other users use it? If so, yeah it should work depending on how you deployed it!
@@WittCodeIt works locally on my pycharm but I want it to be able to work publicly online for anyone through github. But I am not sure if it will work publicly online as only I have the mysql database on my computer. If it can work though, do you know a way i can deploy it with github together with my code, do I need to upload mysql file and if so how would I go about it? If not should I just change it to not local host for it to work for anyone on any computer and how will i got about that?
@@WittCode It works locally on my pycharm but I want it to be able to work publicly online for anyone through github. But I am not sure if it will work publicly online as only I have the mysql database on my computer. Should I make it not localhost for it to work on github?
thanks a lot
Thnx mahn
Do you have a video on how to load MySQL data to Hadoop?
I have officially connected MySQL using this video (thanks by the way, helped a lot).
Hey Amel! Thanks for watching! Sadly I do not as I am not too familiar with Hadoop. 😄
do you have more example for mysql with python
Thanks.
Where can I find the connect function under mysql module ?
¡Gracias!
Cool, you helped me, with my problem
That's great to hear Nicola! Glad I could help! 😀
Thank you very much ❤️
Anytime! Thanks for watching! 😃
Very helpful 👍
Thanks so much Umair!
Thanks for your great video! I want to ask is there a method to mandate all the users like google's Firebase? Say, someone registers an account on another computer, and then his account status can be checked on my computer.
thank you, keep going
Thanks for watching Omnia! 😀
can u to the same video for MAC OS connection
i did like yr video keep going
Thanks so much! 😃
Hey WittCode, i have a question? I assume you are professional and im curious where you work / what you do.
Hey Dillon good to hear from you again! I am a full stack developer in javascript but I have only recently started. I actually did chemistry in college and I taught myself this stuff!
Hola buen día
Estoy usando mysql.connector pero en consola me muestra el usario y password en la consola, cómo se deshabilita esto ya que obviamente no quiero mostrar las credenciales porque esa salida la voy a guardar en un archivo, ya lo Googlie y no encuentro cómo
thanks man
No problem Andy! Thanks for watching! 🤠
I appreciate the video but mysql that I have on my computer looks nothing like yours and does not have the same options.
Hello there, I have another issue.
I had to reinstall PyCharm on a different laptop but can't see any packages in the python interpreter and I can't even add any due to the plus button being greyed out.
Hey good to hear from you again Mohamed! I haven't experienced this personally but you might have to actually add the actual online repository to pycharm.
1.) Go to Settings
2.) Project interpreter
3.) Click the + sign on top right edge
4.) Go to manage repositories,
5.) Press the + Sign, then add pypi.python.org/pypi
6.) Press Ok
Let me know if this helps!
@@WittCode thanks a lot this helped a lot. Thanks again.
Do you have a crud tutorial of this?
pycharm output says the above exception was direct cause of the following exception.
No way for me to connect... it keeps throwing at me the same crap. Traceback (most recent call last):
File "C:\Users\flosr\pyver\py311\Lib\site-packages\mysql\connector\connection_cext.py", line 291, in _open_connection
self._cmysql.connect(**cnx_kwargs)
_mysql_connector.MySQLInterfaceError: Can't open named pipe to host: . pipe: MySQL (2)
I did exactly what you did but it is giving me some error now can you fix please?
Hey I am having some trouble can you help me please?
ALLAH RAZI OLSUN
I am getting this=mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported
what I should do?
I am not able to solve this issue from week. please help me.
Hey Sanjeev! Did you install the correct mysql connector at the beginning of the video? I have heard of this issue when the wrong connector is installed.
@@WittCode yes, I have installed the same connector which you have said.
@@sanjeevkumar-iw2lz Hmmm so another solution I can see is adding this to your connection constructor: auth_plugin='mysql_native_password'
@@WittCode yeahh, it worked, thanks.but can you please explain, what it is and why I have to do it.?
@@sanjeevkumar-iw2lz Great to hear! Which version of MySQL are you using? caching_sha2_password is the default authentication mechanism for MySQL 8.0. If what you are connecting to (here it is your MySQL server) uses a different form of authentication, then you need to use the auth_plugin argument to specify this!
I also have this error mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on '%-.100s:%u' (%s) (Warning: %u format: a number is required, not str)
Hey there! If you look online it seems that this could be an issue with your port number. Make sure the port you are specifying is the correct one. The default for MySQL is 3306 but you could have made it a different number when setting up your MySQL server. Let me know if this works!
@@WittCode hi it worked thanks
@@wyndhamwoo2851 Great to hear!
@@WittCode Do you know any way to import a database file (.db) into pycharm or to make one, perhaps from a csv file, so that it can be used like this.
self.connection = sqlite3.connect("example.db")
@@WittCode I just want to ask if this can work when on other computers. For example if I want to use it in a public app. Or can it only work on my computer?
Hello, firstly of all, ı liked your video but how can I send data from pycharm to sql
Hey Nurseli thanks for watching! Do you mean like instead of retrieving data from the database you want to insert data?
@@WittCode Yes exactly
@@WittCode can you take a video about like this
@@nurselikaya9479 I will definitely be making more videos on interacting with SQL and python but to do that it would simply be changing the SQL statement from where I said "select * from" to an SQL insert statement! If you look at W3 schools insert statement you'll learn the basics of how to do it 🤠
Hi buddy can you help me with my code
Hey Adesh! Sure what seems to be the problem?
please make your text bigger, i can't see your screen clearly
Hey there! Thanks for the feedback I could definitely zoom in a little more! 😀
thank you !
thanks bro😀