0

Hi

Hope someone can help with this as I dont really know where to start.

I am trying to automate a quite large txt feed I get from an external url to import into database. I currently do it manually through database software, but it takes too long each day.

Can anyone give me a pointer

Cheers

2
Contributors
4
Replies
36
Views
4 Years
Discussion Span
Last Post by mpc123
0

I can think of one solution that i have tried .First of all copy database from source to destination server and then import database into MySQL.

So both of these can be automated by using batch code and then adding the process to windows scheduler to schedule to execute batch file at paticular interval.

Create a batch file it will be similar to this

@ECHO OFF
for /f "tokens=1-4 delims=/ " %%a in ('date/t') do (
set dw=%%a
set mm=%%b
set dd=%%c
set yy=%%d
)

SET bkupdir=C:\path\to\where\you\want\backups
SET mysqldir=D:\path\to\mysql
SET dbname=this_is_the_name_of_my_database
SET dbuser=this_is_my_user_name

@ECHO Beginning backup of %dbname%...

%mysqldir%\bin\mysqldump -B %dbname% -u %dbuser% > %bkupdir%\dbBkup_%dbname%_%yy%%mm%%dd%.sql
@ECHO Done! New File: dbBkup_%dbname%_%yy%%mm%%dd%.sql
pause

and then use xcopy command to copy this file to another after this command in this batch file.

Then in your system similarly create batch code to import using mysql and add it to scheduler.

0

Hi

Thanks for your reply, but I only have to do 2 clicks and everything is imported manually. I am looking for something that is automated

0

In above example that i have given,you don't have to click.It is automated process.Datavase will be backed up than copied to another server and then it is imported in that server.No manual process.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.