In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following brings you an introduction to the basic usage of python-pymysql, hoping to give you some help in practical application.
MYSQL involves a lot of things, and there are not many theories. There are many books on the Internet. Today, we will use the accumulated experience in the industry to do an answer.
1. Basic usage
Import pymysql# establish connection conn=pymysql.connect (host='localhost', port=3306, user='root', password='123456', db='mydb') # create cursor cursor=conn.cursor () # execute sqleffect_row=cursor.execute ("select * from student") # query the first line # row_1=cursor.fetchone () # print (row_1) # query all row_all=cursor.fetchall () print (row_all) conn.commit () cursor.close ()
Conn.close ()
After reading the above introduction to the basic usage of python-pymysql, if there is anything else you need to know, you can find out what you are interested in in the industry information or find our professional technical engineer to answer, the technical engineer has more than ten years of experience in the industry.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.