Bug #62369 | mysql client - Source command for reading files depends on which OS ?? | ||
---|---|---|---|
Submitted: | 7 Sep 2011 7:24 | Modified: | 13 Sep 2011 18:47 |
Reporter: | Don Cohen | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S3 (Non-critical) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[7 Sep 2011 7:24]
Don Cohen
[7 Sep 2011 8:02]
Don Cohen
It now finally occurs to me that the source command is supposed to cause the CLIENT to read the file and send its contents to the server. Is there a command that causes the SERVER to read a file? Similarly, I now think the system command causes the client to execute the command on its own system - is there a way to get the command executed on the server?
[7 Sep 2011 9:06]
Valeriy Kravchuk
SQL is sent to server from client. So it should be some client (maybe running on the same machine as server) that will send SQL to server for further execution. SOURCE is a command of mysql command line client.
[13 Sep 2011 18:47]
Don Cohen
The whole area of what's done on client vs server is not very clear from documentation and when I do understand it I see problems. http://dev.mysql.com/doc/refman/5.5/en/load-data.html says LOAD DATA INFILE is the complement of SELECT ... INTO OUTFILE. (See Section 12.2.9, “SELECT Syntax”.) To write data from a table to a file, use SELECT ... INTO OUTFILE. To read the file back into a table, use LOAD DATA INFILE. However, this is not correct. Load reads data from the client, while select into outfile writes on the server! Is there a way to write to a file on the client from the mysql command line? (I know you can do it with -B -e command.)
[13 Sep 2011 19:02]
Peter Laursen
Correction: LOAD DATA INFILE reads file from the server LOAD DATA LOCAL INFILE read file from the client machine SELECT INTO OUTFILE saves a file on the server (and SELECT INTO LOCAL OUTFILE is not supported unfortunately). But I do not understand how this is related to the topic/discussion here ('Source command .. )? A file loaded with SOURCE command will have to be (valid) SQL if it shall not raise an error. INFILE's and OUTFILES are CSV-files (in the widest possible meaning of the term). Peter (not a MySQL person)