in reply to Trouble opening FIFO for speedy MySQL loading

From the mysql page you reference:

Note that you must run the command that generates the data to be loaded and the mysql commands either on separate terminals, or run the data generation process in the background (as shown in the preceding example). If you do not do this, the pipe will block until data is read by the mysql process.

Trying to open a fifo as write-only will block until something opens it to read.
  • Comment on Re: Trouble opening FIFO for speedy MySQL loading

Replies are listed 'Best First'.
Re^2: Trouble opening FIFO for speedy MySQL loading
by ultrachrome (Initiate) on Nov 04, 2008 at 17:51 UTC

    Yes, I've read that but I'm having trouble demonstrating what it really means.

    Are you saying that the open statement will complete once I begin reading from the file?

    I did try running the load data infile statement while the script was hanging at open but nothing happened.

    Any help would be appreciated. Thanks.

      I would need to see exactly what you are trying in order to comment. I created the following script:
      #!/usr/bin/perl -w use strict; use IO::File; my $fifo = "fifo"; sysopen(FIFO, $fifo, O_RDONLY) or die "can't read $fifo: $!"; close FIFO;
      I kicked off your script in background, where it hung. When I run this script, the original script (the one you previously posted) exits, indicating that the open completed.