Files
auto_cursor/IMPORT_README.md
2025-04-01 15:43:27 +08:00

83 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 邮箱导入工具使用说明
这个导入工具用于将邮箱账号导入到MySQL数据库中支持Redis缓存。
## 功能特点
1. 支持MySQL数据库存储
2. 可选启用Redis缓存
3. 详细的导入日志
4. 自动处理重复邮箱
5. Windows平台兼容性优化
## 前置条件
1. MySQL/MariaDB数据库服务已运行
2. 已在`config.yaml`中配置好数据库连接信息
3. Redis服务可选
## 邮箱数据格式
邮箱数据文件应使用以下格式,每行一个账号:
```
email@example.com----密码----client_id----refresh_token
```
字段说明:
- `email`: 邮箱地址
- `password`: 邮箱密码
- `client_id`: Microsoft应用的客户端ID
- `refresh_token`: Microsoft OAuth的刷新令牌
## 使用方法
1. 确保MySQL数据库已正确配置
编辑`config.yaml`文件设置正确的MySQL连接信息
```yaml
database:
host: "localhost"
port: 3306
username: "auto_cursor_reg"
password: "your_password"
database: "auto_cursor_reg"
```
2. 准备邮箱数据文件
默认读取`email.txt`文件,也可以在`config.yaml`中指定:
```yaml
email:
file_path: "path/to/your/email_file.txt"
```
3. 运行导入工具
```bash
python import_emails.py
```
4. 查看导入结果
导入过程和结果会显示在控制台,详细日志保存在`import_emails.log`文件中。
## 常见问题
1. **无法连接数据库**
- 检查MySQL服务是否启动
- 确认用户名和密码正确
- 确认数据库名称存在
2. **导入失败**
- 检查邮箱数据文件格式是否正确
- 查看导入日志获取详细错误信息
3. **重复邮箱处理**
- 系统会自动跳过重复的邮箱,并在日志中标记
## 注意事项
- 导入前建议备份原有数据
- 大批量导入时建议适当增加MySQL的连接超时设置
- 导入成功后可以运行主程序开始注册流程