自动将DB5访问MySQL [英] Access DB5 to MySQL automatically

查看:71
本文介绍了自动将DB5访问MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了问题,希望我可以从这里的一些经验中获得建议和正确方向的推动.我有一个由专用软件制作的MS Access文件.我只想从该表中取出一半的列,然后导入到新的(尚未设置)mysql数据库中.

I have a problem, and was hoping I could rely on some of the experience here for advice and a push in the right direction. I have an MS Access file made by propietary software. I only want to take half the columns from this table, and import into new(not yet setup)mysql database.

我不知道该怎么做或最好的方法是什么.每天晚上将获取新数据,并将其作为自动任务再次导入.

I have no idea how to do this or what the best way is. New data will be obtained each night, and again imported, as an automatic task.

访问数据库中的一列是jpeg文件的URL,我想下载此文件并自动以BLOB类型导入数据库.

One of the columns in the access database is a url to a jpeg file, I want to download this file and import into the database as a BLOB type automatically.

有没有一种方法可以自动执行此操作?这将在Windows机器上,所以也许可以用WSH编写脚本?

Is there a way to do this automatically? This will be on a windows machine, so perhaps it could be scripted with WSH?

推荐答案

这是使用 linux 示例. sourceforge.net/"rel =" noreferrer> mdbtools 用于自动提取并从mdb文件导入到mysql.

This is a bash script linux example using mdbtools for automatic extraction and import from a mdb file to mysql.

#!/bin/bash

MDBFILE="Data.mdb"

OPTIONS="-H -D %y-%m-%d"
mdb-export $OPTIONS $MDBFILE  TableName_1 >  output_1.txt
mdb-export $OPTIONS $MDBFILE  TableName_2 >  output_2.txt

mdb-export $OPTIONS $MDBFILE  TableName_n >  output_n.txt

MYSQLOPTIONS=' --fields-optionally-enclosed-by=" --fields-terminated-by=, -r '
mysqlimport $MYSQLOPTIONS -L -uuser -ppasword database output_1.txt
mysqlimport $MYSQLOPTIONS -L -uuser -ppasword database output_2.txt
mysqlimport $MYSQLOPTIONS -L -uuser -ppasword database output_n.txt

您可以使用其他一些mysqlimport选项: --delete:从目标mysql表中删除先前的数据. --ignore:忽略重复项 --replace:如果发现重复则替换

You can use some others mysqlimport options: --delete: to delete previous Data from the target mysql table. --ignore: ignore duplicates --replace: replace if a duplicate is found

这不是Windows解决方案,但希望对您有所帮助.

It's not a windows solution but i Hope it helps.

这篇关于自动将DB5访问MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆