当前位置:网站首页>PY3 link MySQL
PY3 link MySQL
2022-07-02 03:21:00 【Little wooden man】
# -*- coding: UTF-8 -*-
import pymysql
# Open database connection
db = pymysql.connect(host='192.168.1.6',
user='root',
passwd='admin',
port=3307,
database='hxjxequities')
# Use cursor() Method to create a cursor object cursor
cursor = db.cursor()
# Use execute() Method execution SQL Inquire about
cursor.execute(" SELECT VERSION() ")
# Use fetchone() Method to get a single piece of data .
data = cursor.fetchone()
print("mysqldb version : %s " % data)
# Close database connection
db.close()
边栏推荐
- Global and Chinese markets for welding equipment and consumables 2022-2028: Research Report on technology, participants, trends, market size and share
- [HCIA continuous update] working principle of OSPF Protocol
- Named block Verilog
- GSE104154_scRNA-seq_fibrotic MC_bleomycin/normalized AM3
- Verilog 线型wire 种类
- PMP personal sprint preparation experience
- 2022 hoisting machinery command examination paper and summary of hoisting machinery command examination
- 旋转框目标检测mmrotate v0.3.1 学习模型
- Use blocking or non blocking for streamline
- [JVM] detailed description of the process of creating objects
猜你喜欢

West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials

Baohong industry | 6 financial management models at different stages of life

汇率的查询接口

高并发场景下缓存处理方案

Golang configure export goprivate to pull private library code

Force deduction daily question 540 A single element in an ordered array

Baohong industry | what misunderstandings should we pay attention to when diversifying investment

Discussion on related configuration of thread pool

Detailed explanation of ThreadLocal

创业了...
随机推荐
MSI announced that its motherboard products will cancel all paper accessories
In depth interpretation of pytest official documents (26) customized pytest assertion error information
ORA-01547、ORA-01194、ORA-01110
A list of job levels and salaries in common Internet companies. Those who have conditions must enter big factories. The salary is really high
Delphi xe10.4 installing alphacontrols15.12
自定义组件的 v-model
V-model of custom component
初出茅庐市值1亿美金的监控产品Sentry体验与架构
2022-2028 global manual dental cleaning equipment industry research and trend analysis report
Grpc quick practice
PHP array processing
Qualcomm platform WiFi -- P2P issue (2)
Verilog wire type
Xiaomi, a young engineer, was just going to make soy sauce
Redis set command line operation (intersection, union and difference, random reading, etc.)
Rotating frame target detection mmrotate v0.3.1 learning model
Knowing things by learning | self supervised learning helps improve the effect of content risk control
Global and Chinese markets for ultrasonic probe disinfection systems 2022-2028: Research Report on technology, participants, trends, market size and share
Discrimination between sap Hana, s/4hana and SAP BTP
el-table的render-header用法