SET autocommit=0;  # wymagane dla tabel InnoDB
LOCK TABLES MojaTabela WRITE;
FLUSH TABLES; #zapis buforów na dysk
SELECT * INTO OUTFILE 'c:\wynik.txt' FIELDS TERMINATED BY ',' 
OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM MojaTabela;
UNLOCK TABLES;
