Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using 'source' command...

Status
Not open for further replies.

showtimenz

Technical User
Dec 16, 2003
3
NZ
when using the 'source' command to run a script, can i specify a local filename when accessing mysql remotely?? this is what i am doing...

mysql> source c:\temp\script.sql

and am getting this response...

ERROR:
Failed to open file 'c:\temp\script.sql', error: 2

error: 2, i understand is a file not found error...

the other alternative is to upload the script to the remote server that i am using and enter the path of the script, but this could be difficult as the server is a shared server admined by my ISP and i don't know the entire path from the root of the server and i am not sure if the ISP will disclose that info...

so if there is anyway to run a local script it would be cool if someone could tell me :eek:)

cheers

 
I've just tried this on windows 2000 and it works fine.
Have you checked that the file actually does exist ?, have you tried using a file in the directory you start the mysql program from i.e. so you do not have to specify a path ?
 
If I remember rightly, path /'s must be the unix / not \ so try c:/temp/script.sql


______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
i am using Win98, but mysql is running on a remote UNIX server... i am trying to run a script local on my Win98 machine on the remote UNIX server.

i have tried both / and \ with no luck...

do you think the version of mysql server matters? as it is 3.23.56-log, which is not the current version.

LOAD DATA LOCAL INFILE "datafile" INTO TABLE table; is not even supported...
 
ah now see, thats the problem , if you are gonna use the source command you must know the fully qualified path of the file so that the server understands how to find it ...
its far easier to ftp the file to the server and then use the source command, than to go to the hassle of seeting up file sharing , opening all sorts of connections, identifiying your internet ip and then using say \. ////ip.address.here.//sharename/path/to/filename.sql

the remote server doesnt understand c: only your windows box knows that.

The server only knows its own file system. Im not sure if you can host the file somewhere and use \. etc - never tried it and not likely to.


hope this helps. (by the way if the file isnt too big, copy and paste works with most free telnet clients e.g. puTTy.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
a lightbulb turned on in my head this morning, so figured out what you said... DUH!!

but thanks anyways...

managed to get it up and running, used a tool called PHPmyAdmin. quite a nice little utility...

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top