当前位置:网站首页>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 }',
边栏推荐
- Oracle数据库的闪回技术
- Article 48 - Analysis of timestamp2 parameters【2022-08-01】
- 攻防世界----unfinish
- Reading IDEO, Design Changes Everything
- wait() ,notify(),notifyAll()以及wait()与sleep()比较
- 什么是 commonjs2
- Mysql视图
- 电脑死机,Word忘了保存怎么办?怎么恢复?(编辑器是WPS)
- Get out of the machine learning world forever!
- RISC-V instruction format and 6 basic integer instructions
猜你喜欢
随机推荐
Oracle数据库的闪回技术
FreeBSD bnxt以太网驱动源码阅读记录三:
GTK:Gdk-CRITICAL **: IA__gdk_draw_pixbuf: assertion ‘GDK_IS_DRAWABLE (drawable)‘ failed
WeChat applet getPhoneNumber interface code=40013
栈 && 队列
Automatically generate code generator recommendation-code-gen
Selenium本地打开远程浏览器
Mysql index details (with pictures and texts)
【typescript】使用antd中RangePicker组件实现时间限制 当前时间的前一年(365天)
Oracle update error operation single table rollback
多个驻外使领馆发提醒 事关赴华出行、人身财产安全
.Net 5.0 Quick Start Redis
Seata Distributed Transaction
ttl电平与rs232电平转换电路(232电平定义)
社区收藏缓存设计重构实战
[C language] Explicit array solution (1)
【C语言】虐打循环练习题(2)
【ONE·Data || 排序入门】
Based on the flask mall administrator functions
C语言提高篇(三)