outfile

How to store output of a stored procedure on to disk

Hi, We are using SQL Server 2005. I want to create the file of the output of the stored procedure. ...

Access denied error on select into outfile using Zend

Hi, I'm trying to make a dump of a MySQL table on the server and I'm trying to do this in Zend. I have a model/mapper/dbtable structure for all my connections to my tables and I'm adding the following code to the mappers: public function dumpTable() { $db = $this->getDbTable()->getAdapter(); $name = $this->getDbTable()->info('na...

Mysql through PHP gives a "Can't create/write to file" error

The full error is: Message: Mysqli statement execute error : Can't create/write to file '/var/www/zendApp/backup/mysql/1268733580_name.sql' (Errcode: 13) I have tried several things already with the /var/www/ZendApp/backup/mysql directory $chmod 777 mysql $chmod 1777 mysql $chown root:root mysql $chown mysql:mysql mysql Bu...

MySQL SELECT INTO OUTFILE to a different server?

I have a shell script on server a. The script spits out a csv file to a local directory. The problem is the database server is on server b. How do I use select * into outfile in a setup like this? I get Can't create/write to file '/home/username/test.csv/' (Errcode: 2) Solved load data infile by using 'LOCAL' keyword. Is there somet...

How do I export a large table into 50 smaller csv files of 100,000 records each

I am trying to export one field from a very large table - containing 5,000,000 records, for example - into a csv list - but not all together, rather, 100,000 records into each .csv file created - without duplication. How can I do this, please? I tried SELECT field_name FROM table_name WHERE certain_conditions_are_met INTO OUTFILE ...

Weird problems with mysql outfile under FreeBSD

See my answer below. Leaving this up in case it helps someone else. Hi guys, What follows is a series of attempts to dump a query to an outfile on a new FreeBSD box that my site has moved to. The results are the same if I log in as me or if I log in as root. I hope the style isn't too annoying. I have my comments commented out arou...

MYSQL STORED PROCEDURE with OUTFILE with no spaces in txt file

I would like to export a query result in a txt file, but with no field separators like this: field1field2field3field4 if I use the fields terminated by and optionally enclosed by and set them to '', I still get some kind of tabs between fields... How can I get the output right? thanks in advance... ...