应用场景,数据库数据达到千万以后,做数据分析执行脚本开始变慢,所以用到clickhouse,先插入一亿数据测试
先安装pip支持mysql.connector,我安装的python3.11
pip3 install mysql-connector-python
再使用pip3 list
查看是否安装成功
以下是mysql创建表语句
CREATE TABLE `test_table` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`recharge_amount` int(11) DEFAULT NULL,
`bonus` decimal(12,2) DEFAULT NULL,
`message` varchar(255) DEFAULT NULL,
`content` varchar(255) DEFAULT NULL,
`remark` varchar(255) DEFAULT NULL,
`order_id` varchar(32) DEFAULT NULL,
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=50000001 DEFAULT CHARSET=utf8;
标签:varchar,python,一亿,DEFAULT,int,mysql,NULL,id From: https://www.cnblogs.com/stronger-xsw/p/17471652.html