当前位置:网站首页>rust使用mysql插入数据
rust使用mysql插入数据
2022-08-02 13:40:00 【CSDN问答】
Rust使用mysql库的时候,插入数据报错
问题相关代码
//连接数据库 let url = "mysql://root:[email protected]/Contract"; let pool = Pool::new(url).unwrap(); let mut conn = pool.get_conn().unwrap(); //插入数据 conn.exec_drop( "INSERT INTO Contract_info (name, totalSupply) VALUES (:name, :totalSupply)", params! { "name"=>"name", "totalSupply"=>"totalSupply", }, ).unwrap();
运行结果及报错内容
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: MySqlError { ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?Supply, ?, ?, ?)' at line 1 }',
边栏推荐
- Cannot determine loading status from target frame detached when selenium chrome driver is running
- 大而全的pom文件示例
- Article 48 - Analysis of timestamp2 parameters【2022-08-01】
- 【622. 设计循环队列】
- tinymce-plugins
- Reading IDEO, Design Changes Everything
- RESTful style (detailed introduction + case implementation)
- 社区收藏缓存设计重构实战
- SQL函数 UPPER
- Automatically generate code generator recommendation-code-gen
猜你喜欢
随机推荐
HALCON: 内存管理(Memory Management)
你真的懂单例模式么
els 长条方块变形条件、边界碰撞判定
Win11怎么修改关机界面颜色?Win11修改关机界面颜色的方法
线程安全问题及关键字synchronized,volatile
科研试剂DSPE-PEG-VIP,二硬脂酰基磷脂酰乙醇胺-聚乙二醇-血管活性肠肽VIP
基于华为eNSP的企业网络规划
How to do short video food from the media?5 steps to teach you to get started quickly
腾讯安全游戏行业研讨会:生态共建,护航游戏产业健康发展
.Net 5.0快速上手 Redis
The uniapp/applet onload method executes the interpretation every time the page is opened
面试SQL语句,学会这些就够了!!!
【C语言】细品分支结构——switch语句
This binding to detailed answers
Based on the flask mall administrator functions
WiFi Association&Omnipeek抓包分析
【C语言】细品分支结构——if-else语句
GTK:Gdk-CRITICAL **: IA__gdk_draw_pixbuf: assertion ‘GDK_IS_DRAWABLE (drawable)’ failed
二进制中1的个数
RISC-V instruction format and 6 basic integer instructions