forums › forums › SQLyog › Using SQLyog › Command line access?
- This topic is empty.
-
AuthorPosts
-
-
October 5, 2003 at 10:34 am #8196powerpetsMember
Hi all,
mySQL seems to be running quite stable for the past few months, and I'm ready to start porting more from msSQL to mySQL. The sqlyog utility has helped me greatly.
I can do the following in sqlyog:
delete from highscore where hi_gameID=16;
insert into highscore (hi_gameID, hi_UID, hi_Uname, hi_score)
select ga_gameID, ga_UID, ga_UName, ga_score FROM gamerecord WHERE ga_gameID=16 ORDER BY ga_score desc limit 0,20;
How do I automate this to run hourly??
I tried to do it using mysql, however it just gives me a bunch of arrows… until I press CTRL-Break.
-
October 5, 2003 at 11:08 am #15017powerpetsMember
Getting there….
the -> was coming because I forgot the ; at the end…
Haven't used a non-gui interface in a long time…
Anyway, here's what I did:
I created a upd_highscore.scr file that contains the delete and insert commands :
delete from highscore where hi_gameID=16;
insert into highscore (hi_gameID, hi_UID, hi_Uname, hi_score)
select ga_gameID, ga_UID, ga_UName, ga_score FROM gamerecord WHERE ga_gameID=16 ORDER BY ga_score desc limit 0,20;
Saved it, and am trying to run the file by using:
D:>mySQL powergame -e “upd_highscore.scr”
When I do that, I receive :
ERROR 1064 at line 1: 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 'upd_highscore.scr' at line 1
yet when I run the commands individually, they run fine??
Any help is appreciated 🙂
-
October 5, 2003 at 11:09 am #15018powerpetsMember
also, when I do the following:
d:> mySQL powergame
mySQL> source upd_highscore.scr
it runs fine…
-
October 5, 2003 at 11:13 am #15019powerpetsMember
Changed upd_highscore.scr file to include:
connect powergame;
on first line
Using:
d:>mysql -e upd_highscore.scr
same result.
-
October 5, 2003 at 11:54 am #15020powerpetsMember
Never mind, it's working
Just a simple
mySQL < upd_highscore.scr dropped that in a bat file and added to the scheduler…
-
-
AuthorPosts
- You must be logged in to reply to this topic.