当前位置:网站首页>The data read by pandas is saved to the MySQL database
The data read by pandas is saved to the MySQL database
2022-07-03 10:02:00 【Star soul is not a dream】
sudo cat /etc/mysql/debian.cnf
user = debian-sys-maint
password = xxxxx
import pandas as pd
from sqlalchemy import create_engine
host = '127.0.0.1'
db = 'test'
user = 'debian-sys-maint'
password = 'xxx'
print(str(r"mysql+pymysql://%s:" + '%s' + "@%s/%s") % (user, password, host, db))
engine = create_engine(str(r"mysql+pymysql://%s:" + '%s' + "@%s/%s") % (user, password, host, db))
try:
df = pd.DataFrame([[1,'x'],[2,'y']],columns=list('ab'))
df.to_sql('test1',con=engine,if_exists='replace',index=False)
except Exception as e:
print(e)
边栏推荐
- A lottery like scissors, stone and cloth (C language)
- The 4G module designed by the charging pile obtains NTP time through mqtt based on 4G network
- 开学实验里要用到mysql,忘记基本的select语句怎么玩啦?补救来啦~
- 学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里
- 嵌入式本来就很坑,相对于互联网来说那个坑多得简直是难走
- I didn't think so much when I was in the field of single chip microcomputer. I just wanted to earn money to support myself first
- Programming ideas are more important than anything, not more than who can use several functions, but more than the understanding of the program
- [Li Kou brush question notes (II)] special skills, module breakthroughs, classification and summary of 45 classic questions, and refinement in continuous consolidation
- Assignment to '*' form incompatible pointer type 'linkstack' {aka '*'} problem solving
- openEuler kernel 技术分享 - 第1期 - kdump 基本原理、使用及案例介绍
猜你喜欢
C language enumeration type
An executable binary file contains more than machine instructions
Open Euler Kernel Technology Sharing - Issue 1 - kdump Basic Principles, use and Case Introduction
单片机学到什么程度能找到工作,这个标准不好量化
Eight working modes of stm32gpio and chip naming rules
Assignment to '*' form incompatible pointer type 'linkstack' {aka '*'} problem solving
Timer and counter of 51 single chip microcomputer
CEF download, compile project
There is no specific definition of embedded system
学习开发没有捷径,也几乎不存在带路会学的快一些的情况
随机推荐
STM32 interrupt switch
Exception handling of arm
Stm32-hal library learning, using cubemx to generate program framework
Not many people can finally bring their interests to college graduation
03 FastJson 解决循环引用
(2)接口中新增的方法
我想各位朋友都应该知道学习的基本规律就是:从易到难
Oracle database SQL statement execution plan, statement tracking and optimization instance
Synchronization control between tasks
Introduction to chromium embedded framework (CEF)
My 4G smart charging pile gateway design and development related articles
Eight working modes of stm32gpio and chip naming rules
My notes on the development of intelligent charging pile (III): overview of the overall design of the system software
Fundamentals of Electronic Technology (III)_ Chapter 2 principle of amplification circuit__ Crystal triode and field effect triode
openEuler kernel 技术分享 - 第1期 - kdump 基本原理、使用及案例介绍
干单片机这一行的时候根本没想过这么多,只想着先挣钱养活自己
当你需要使用STM32某些功能,而51实现不了时, 那32自然不需要学
Mobile phones are a kind of MCU, but the hardware it uses is not 51 chip
is_ power_ of_ 2 judge whether it is a multiple of 2
Working mode of 80C51 Serial Port