HomeUsesLinksSnippetsProjectsContact me
InstagramTikTokYouTubeTwitterTwitchGitHubLinkedIn
HomeUsesLinksSnippetsProjectsContact me
04 February 2017

MySQL - export query results to file

SELECT
p.first_name as "Name", p.last_name as "Surname"
FROM persons p
WHERE p.person_type_id= 2
ORDER BY p.created_at DESC
INTO OUTFILE '/tmp/persons.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';

Results of this query will be saved to file /tmp/persons.csv


VIM - add text to beginning of every lineMySQL - Adding or removing individual SQL modes

Pages

  • Home
  • Uses
  • Links
  • Snippets
  • Projects
  • Contact me

More

  • PHP Serialize Online
  • PHP Unserialize Online
  • PHP Playground Online
  • WP Admin Online
  • Dedicated WordPress maintenance plans
  • IP Address Check
  • Sitemap to llms.txt
  • By Human Not AI Badges

Created with ☕ by Michal Slepko and Rootscope