SlideShare a Scribd company logo
Section: BS in Information Technology - 2A
Day: FRI
Time: 1:00-4:00
Instructor: Percival A. Fernandez, MSIT
PYTHON + MYSQL
• This section shows you how to use MySQL Connector/Python to
access MySQL databases.
• You’ll learn how to connect to MySQL database and perform
common database operations such as SELECT, INSERT, UPDATE
and DELETE in Python
GETTING STARTED WITH MYSQL PYTHON
CONNECTOR
• To access the MySQL database from Python, you need a
database driver. MySQL Connector/Python is a standardized
database driver provided by MySQL.
• MySQL Connector/Python is designed specifically to MySQL. It
supports all MySQL extensions such as LIMIT clause.
• MySQL Connector/Python allows you to compress the data
stream between Python and MySQL database server using
protocol compression. It supports connections using TCP/IP
socket and secure TCP/IP connection using SSL.
• MySQL Connector/Python is an API implemented using pure
Python. It means that you don’t need to install any MySQL client
library or any Python modules except the standard library.
GETTING STARTED WITH MYSQL PYTHON
CONNECTOR
• MySQL Connector/Python versions
• You will need to install the correct versions of Python, MySQL,
and Connect/Python. The following table illustrates the
compatible versions of Connect/Python, MySQL, and Python:
Connector/Pyth
on Version
MySQL Server Versions Supported Python
Versions
8.0 8.0, 5.7, 5.6, 5.5 3.6, 3.5, 3.4, 2.7
2.2 5.7, 5.6, 5.5 3.5, 3.4, 2.7
2.1 5.7, 5.6, 5.5 3.5, 3.4, 2.7, 2.6
2.0 5.7, 5.6, 5.5 3.5, 3.4, 2.7, 2.6
1.2 5.7, 5.6, 5.5 (5.1, 5.0,
4.1)
3.4, 3.3, 3.2, 3.1, 2.7, 2.6
INSTALLING MYSQL CONNECTOR/PYTHON
• Before installing MySQL Connector/Python, you need:
Root or Administrator privileges in order to perform the
installation.
Python installed on your system
Note that the MySQL Connector/Python installation requires
python to be in the system’s PATH or it will fail.
• The pip command allows you to install MySQL Python connector
on any Operating system including Windows, macOS, Linux,
and Unix:
INSTALLING MYSQL CONNECTOR/PYTHON
INSTALLING MYSQL CONNECTOR/PYTHON
• Verifying MySQL Connector/Python installation
• After installing the MySQL Python connector, you need to
test it to make sure that it is working correctly and you are
able to connect to the MySQL database server without any
issues.
• To verify the installation, you use the following steps:
• Open Python command line
• Type the following code
INSTALLING MYSQL CONNECTOR/PYTHON
CONNECTING TO MYSQL DATABASE USING CONNECT()
FUNCTION
REFERENCES:
• https://www.python.org/about/gettingstarted/
• https://www.tutorialspoint.com/python/index.htm
• https://www.geeksforgeeks.org/python-programming-language/
• https://www.w3schools.com/python/default.asp
• https://www.codecademy.com/pages/learn-python-with-pro
• https://www.pythontutorial.net/tkinter/

More Related Content

Similar to Python Programming Part 8 - MYSQL.pptx

MicroProfile as the Istio Programming Model | Virtual Eclipse Community Meetup
MicroProfile as the Istio Programming Model | Virtual Eclipse Community Meetup  MicroProfile as the Istio Programming Model | Virtual Eclipse Community Meetup
MicroProfile as the Istio Programming Model | Virtual Eclipse Community Meetup
Stephanie Swart
 
Connect the Dots: Logging and Custom Connectors
Connect the Dots: Logging and Custom ConnectorsConnect the Dots: Logging and Custom Connectors
Connect the Dots: Logging and Custom Connectors
AaronLieberman5
 
My sql5.7 whatsnew_presentedatgids2015
My sql5.7 whatsnew_presentedatgids2015My sql5.7 whatsnew_presentedatgids2015
My sql5.7 whatsnew_presentedatgids2015
Sanjay Manwani
 
Python - mySOL
Python - mySOLPython - mySOL
Python - mySOL
Learnbay Datascience
 
Netherlands Tech Tour - 07 MySQL Whats upcoming in 5.7
Netherlands Tech Tour - 07 MySQL Whats upcoming in 5.7Netherlands Tech Tour - 07 MySQL Whats upcoming in 5.7
Netherlands Tech Tour - 07 MySQL Whats upcoming in 5.7
Mark Swarbrick
 
Class 12 CS Ch-16 MySQL PPT.pptx
Class 12 CS Ch-16 MySQL PPT.pptxClass 12 CS Ch-16 MySQL PPT.pptx
Class 12 CS Ch-16 MySQL PPT.pptx
DeepaG66
 
Puppet Keynote: Puppet Camp London
Puppet Keynote: Puppet Camp LondonPuppet Keynote: Puppet Camp London
Puppet Keynote: Puppet Camp London
Puppet
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
Alkin Tezuysal
 
Puppet Camp Tokyo 2014: Keynote
Puppet Camp Tokyo 2014: KeynotePuppet Camp Tokyo 2014: Keynote
Puppet Camp Tokyo 2014: Keynote
Puppet
 
ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)
Mathew Beane
 
How to upgrade like a boss to MySQL 8.0 - PLE19
How to upgrade like a boss to MySQL 8.0 -  PLE19How to upgrade like a boss to MySQL 8.0 -  PLE19
How to upgrade like a boss to MySQL 8.0 - PLE19
Alkin Tezuysal
 
MySQL en el mundo real. Evolución desde la compra por Oracle
MySQL en el mundo real. Evolución desde la compra por OracleMySQL en el mundo real. Evolución desde la compra por Oracle
MySQL en el mundo real. Evolución desde la compra por Oracle
LibreCon
 
Tungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and BeyondTungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and Beyond
Continuent
 
Deep Dive - Usage of on premises data gateway for hybrid integration scenarios
Deep Dive - Usage of on premises data gateway for hybrid integration scenariosDeep Dive - Usage of on premises data gateway for hybrid integration scenarios
Deep Dive - Usage of on premises data gateway for hybrid integration scenarios
Sajith C P Nair
 
Modul 1 integration island
Modul 1   integration islandModul 1   integration island
Modul 1 integration island
CyberSpace
 
CCNA4 Verson6 Chapter2
CCNA4 Verson6 Chapter2CCNA4 Verson6 Chapter2
CCNA4 Verson6 Chapter2
Chaing Ravuth
 
Foreman-and-Puppet-for-Openstack-Audo-Deployment
Foreman-and-Puppet-for-Openstack-Audo-DeploymentForeman-and-Puppet-for-Openstack-Audo-Deployment
Foreman-and-Puppet-for-Openstack-Audo-Deploymentyating yang
 
MySQL Guide for Beginners
MySQL Guide for BeginnersMySQL Guide for Beginners
MySQL Guide for Beginners
Dainis Graveris
 
Hdf installing-hdf
Hdf installing-hdfHdf installing-hdf
Hdf installing-hdf
nmrrsc
 
Monitoring IO performance with iostat and pt-diskstats
Monitoring IO performance with iostat and pt-diskstatsMonitoring IO performance with iostat and pt-diskstats
Monitoring IO performance with iostat and pt-diskstats
Ben Mildren
 

Similar to Python Programming Part 8 - MYSQL.pptx (20)

MicroProfile as the Istio Programming Model | Virtual Eclipse Community Meetup
MicroProfile as the Istio Programming Model | Virtual Eclipse Community Meetup  MicroProfile as the Istio Programming Model | Virtual Eclipse Community Meetup
MicroProfile as the Istio Programming Model | Virtual Eclipse Community Meetup
 
Connect the Dots: Logging and Custom Connectors
Connect the Dots: Logging and Custom ConnectorsConnect the Dots: Logging and Custom Connectors
Connect the Dots: Logging and Custom Connectors
 
My sql5.7 whatsnew_presentedatgids2015
My sql5.7 whatsnew_presentedatgids2015My sql5.7 whatsnew_presentedatgids2015
My sql5.7 whatsnew_presentedatgids2015
 
Python - mySOL
Python - mySOLPython - mySOL
Python - mySOL
 
Netherlands Tech Tour - 07 MySQL Whats upcoming in 5.7
Netherlands Tech Tour - 07 MySQL Whats upcoming in 5.7Netherlands Tech Tour - 07 MySQL Whats upcoming in 5.7
Netherlands Tech Tour - 07 MySQL Whats upcoming in 5.7
 
Class 12 CS Ch-16 MySQL PPT.pptx
Class 12 CS Ch-16 MySQL PPT.pptxClass 12 CS Ch-16 MySQL PPT.pptx
Class 12 CS Ch-16 MySQL PPT.pptx
 
Puppet Keynote: Puppet Camp London
Puppet Keynote: Puppet Camp LondonPuppet Keynote: Puppet Camp London
Puppet Keynote: Puppet Camp London
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
 
Puppet Camp Tokyo 2014: Keynote
Puppet Camp Tokyo 2014: KeynotePuppet Camp Tokyo 2014: Keynote
Puppet Camp Tokyo 2014: Keynote
 
ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)
 
How to upgrade like a boss to MySQL 8.0 - PLE19
How to upgrade like a boss to MySQL 8.0 -  PLE19How to upgrade like a boss to MySQL 8.0 -  PLE19
How to upgrade like a boss to MySQL 8.0 - PLE19
 
MySQL en el mundo real. Evolución desde la compra por Oracle
MySQL en el mundo real. Evolución desde la compra por OracleMySQL en el mundo real. Evolución desde la compra por Oracle
MySQL en el mundo real. Evolución desde la compra por Oracle
 
Tungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and BeyondTungsten Webinar: v6 & v7 Release Recap, and Beyond
Tungsten Webinar: v6 & v7 Release Recap, and Beyond
 
Deep Dive - Usage of on premises data gateway for hybrid integration scenarios
Deep Dive - Usage of on premises data gateway for hybrid integration scenariosDeep Dive - Usage of on premises data gateway for hybrid integration scenarios
Deep Dive - Usage of on premises data gateway for hybrid integration scenarios
 
Modul 1 integration island
Modul 1   integration islandModul 1   integration island
Modul 1 integration island
 
CCNA4 Verson6 Chapter2
CCNA4 Verson6 Chapter2CCNA4 Verson6 Chapter2
CCNA4 Verson6 Chapter2
 
Foreman-and-Puppet-for-Openstack-Audo-Deployment
Foreman-and-Puppet-for-Openstack-Audo-DeploymentForeman-and-Puppet-for-Openstack-Audo-Deployment
Foreman-and-Puppet-for-Openstack-Audo-Deployment
 
MySQL Guide for Beginners
MySQL Guide for BeginnersMySQL Guide for Beginners
MySQL Guide for Beginners
 
Hdf installing-hdf
Hdf installing-hdfHdf installing-hdf
Hdf installing-hdf
 
Monitoring IO performance with iostat and pt-diskstats
Monitoring IO performance with iostat and pt-diskstatsMonitoring IO performance with iostat and pt-diskstats
Monitoring IO performance with iostat and pt-diskstats
 

More from percivalfernandez2

Module 3 - Software Classification.pptx
Module 3 - Software Classification.pptxModule 3 - Software Classification.pptx
Module 3 - Software Classification.pptx
percivalfernandez2
 
Data Analytics.pptx
Data Analytics.pptxData Analytics.pptx
Data Analytics.pptx
percivalfernandez2
 
Python Programming Part 1.pdf
Python Programming Part 1.pdfPython Programming Part 1.pdf
Python Programming Part 1.pdf
percivalfernandez2
 
Wk8_Expansion and External Input and Output Devices.pptx
Wk8_Expansion and External Input and Output Devices.pptxWk8_Expansion and External Input and Output Devices.pptx
Wk8_Expansion and External Input and Output Devices.pptx
percivalfernandez2
 
Advance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdfAdvance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdf
percivalfernandez2
 
Python Programming Part 3.pdf
Python Programming Part 3.pdfPython Programming Part 3.pdf
Python Programming Part 3.pdf
percivalfernandez2
 
Python Programming Part 1.pdf
Python Programming Part 1.pdfPython Programming Part 1.pdf
Python Programming Part 1.pdf
percivalfernandez2
 

More from percivalfernandez2 (7)

Module 3 - Software Classification.pptx
Module 3 - Software Classification.pptxModule 3 - Software Classification.pptx
Module 3 - Software Classification.pptx
 
Data Analytics.pptx
Data Analytics.pptxData Analytics.pptx
Data Analytics.pptx
 
Python Programming Part 1.pdf
Python Programming Part 1.pdfPython Programming Part 1.pdf
Python Programming Part 1.pdf
 
Wk8_Expansion and External Input and Output Devices.pptx
Wk8_Expansion and External Input and Output Devices.pptxWk8_Expansion and External Input and Output Devices.pptx
Wk8_Expansion and External Input and Output Devices.pptx
 
Advance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdfAdvance C# Programming Part 1.pdf
Advance C# Programming Part 1.pdf
 
Python Programming Part 3.pdf
Python Programming Part 3.pdfPython Programming Part 3.pdf
Python Programming Part 3.pdf
 
Python Programming Part 1.pdf
Python Programming Part 1.pdfPython Programming Part 1.pdf
Python Programming Part 1.pdf
 

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 

Recently uploaded (20)

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 

Python Programming Part 8 - MYSQL.pptx

  • 1. Section: BS in Information Technology - 2A Day: FRI Time: 1:00-4:00 Instructor: Percival A. Fernandez, MSIT
  • 2.
  • 3. PYTHON + MYSQL • This section shows you how to use MySQL Connector/Python to access MySQL databases. • You’ll learn how to connect to MySQL database and perform common database operations such as SELECT, INSERT, UPDATE and DELETE in Python
  • 4.
  • 5. GETTING STARTED WITH MYSQL PYTHON CONNECTOR • To access the MySQL database from Python, you need a database driver. MySQL Connector/Python is a standardized database driver provided by MySQL. • MySQL Connector/Python is designed specifically to MySQL. It supports all MySQL extensions such as LIMIT clause. • MySQL Connector/Python allows you to compress the data stream between Python and MySQL database server using protocol compression. It supports connections using TCP/IP socket and secure TCP/IP connection using SSL. • MySQL Connector/Python is an API implemented using pure Python. It means that you don’t need to install any MySQL client library or any Python modules except the standard library.
  • 6. GETTING STARTED WITH MYSQL PYTHON CONNECTOR • MySQL Connector/Python versions • You will need to install the correct versions of Python, MySQL, and Connect/Python. The following table illustrates the compatible versions of Connect/Python, MySQL, and Python: Connector/Pyth on Version MySQL Server Versions Supported Python Versions 8.0 8.0, 5.7, 5.6, 5.5 3.6, 3.5, 3.4, 2.7 2.2 5.7, 5.6, 5.5 3.5, 3.4, 2.7 2.1 5.7, 5.6, 5.5 3.5, 3.4, 2.7, 2.6 2.0 5.7, 5.6, 5.5 3.5, 3.4, 2.7, 2.6 1.2 5.7, 5.6, 5.5 (5.1, 5.0, 4.1) 3.4, 3.3, 3.2, 3.1, 2.7, 2.6
  • 7. INSTALLING MYSQL CONNECTOR/PYTHON • Before installing MySQL Connector/Python, you need: Root or Administrator privileges in order to perform the installation. Python installed on your system Note that the MySQL Connector/Python installation requires python to be in the system’s PATH or it will fail. • The pip command allows you to install MySQL Python connector on any Operating system including Windows, macOS, Linux, and Unix:
  • 9. INSTALLING MYSQL CONNECTOR/PYTHON • Verifying MySQL Connector/Python installation • After installing the MySQL Python connector, you need to test it to make sure that it is working correctly and you are able to connect to the MySQL database server without any issues. • To verify the installation, you use the following steps: • Open Python command line • Type the following code
  • 11. CONNECTING TO MYSQL DATABASE USING CONNECT() FUNCTION
  • 12. REFERENCES: • https://www.python.org/about/gettingstarted/ • https://www.tutorialspoint.com/python/index.htm • https://www.geeksforgeeks.org/python-programming-language/ • https://www.w3schools.com/python/default.asp • https://www.codecademy.com/pages/learn-python-with-pro • https://www.pythontutorial.net/tkinter/