Mysql using SELECT INTO outfile

Source: Internet
Author: User

MySQL supports the default syntax for querying results everywhere

Select: From table to outfile "Filepath\filename.txt";

If you encounter Error 1290 in the process of execution

or set this in the system variable, you need to enter into the Mysql.ini to use this variable, and restart the MySQL service to support this feature.

FilePath defaults to a subfolder of the database in the MySQL data directory on the server, such as:

C:\ProgramData\MySQL\MySQL Server 5.7\data\{your Database name}

  

The file format can support TXT, CSV, and so on.

But a bad thing is, the result is that it contains only data and does not contain a table header. If a table header is required, it needs to be added by means of a union row of header rows before the result.

http://blog.itpub.net/26230597/viewspace-1226728/

Mysql using SELECT INTO outfile

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.