{"id":9647,"date":"2025-09-05T08:06:54","date_gmt":"2025-09-05T08:06:54","guid":{"rendered":"http:\/\/www.withdata.com\/blog\/?p=9647"},"modified":"2025-09-05T09:06:53","modified_gmt":"2025-09-05T09:06:53","slug":"import-data-from-txt-to-mysql-via-command-line-on-macos","status":"publish","type":"post","link":"https:\/\/www.withdata.com\/blog\/my-cmd\/import-data-from-txt-to-mysql-via-command-line-on-macos.html","title":{"rendered":"Import data from TXT to MySQL via command line on MacOS"},"content":{"rendered":"<p>Want to import data from <a href=\"https:\/\/www.google.com\/search?q=site:withdata.com+TXT\">TXT<\/a> file to  <a href=\"https:\/\/www.mysql.com\/\">MySQL<\/a>  via Command Line Interface (CLI) on MacOS?<\/p>\n<p>Using <a href=\"https:\/\/www.withdata.com\/my-cmd\/\">my-cmd<\/a>, a Command Line Interface (CLI) client for MySQL, you can import data from TXT file to MySQL  (MariaDB, Percona) easily and fast. Direct Interaction or Scripting and Automation.<\/p>\n<ul>\n<li>No need to install MySQL client library.<\/li>\n<li>Convenient to deploy to cloud. No need to run installation file, just uncompress and run, immediately.<\/li>\n<li>Commands are entered into a terminal or command prompt, accessed from local or remote (like SSH).<\/li>\n<li>Support Windows, Linux, and MacOS.<\/li>\n<\/ul>\n<p><a href=\"#download-top\" onclick=\"dtv.style.display = 'block';\">Download my-cmd Macos version<\/a>  <a href=\"#download-top\" onclick=\"dtv.style.display = 'block';\"><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/download_3.jpg\" alt=\"Download my-cmd\" width=\"80\" height=\"22\" style=\"max-width:100%;height:auto;\" \/><\/a> <span id=\"dtv\" style=\"display: none;\"><br \/>\n<a href=\"\/down\/my-cmd.darwin-amd64.zip\">my-cmd.darwin-amd64.zip<\/a><br \/>\n<a href=\"\/down\/my-cmd.darwin-arm64.zip\">my-cmd.darwin-arm64.zip<\/a><\/p>\n<p><\/span><\/p>\n<h2>Import data from TXT file to MySQL  (MariaDB, Percona) via command line on MacOS<\/h2>\n<p>1. In interactive mode:<\/p>\n<pre>\nmy-cmd> load loadtype=replace\n      > table=media_messages \n      > datafile=\/data\/media_messages.txt \n      > delimiter=, \n      > quote=\" \n      > header=y;\n<\/pre>\n<p>2. In batch mode:<\/p>\n<pre>\nmy-cmd dsn=\"pan:withdata@192.168.0.102\/test\" task=load loadtype=replace table=media_messages datafile=\/data\/media_messages.txt delimiter=, quote=\" header=y quit=y\n<\/pre>\n<p>&#8220;loadtype=replace&#8221; will delete all data in table before inserting.<\/p>\n<p>See <a href=\"https:\/\/www.withdata.com\/my-cmd\/load.html\">parameters detail<\/a>.<\/p>\n<hr style=\"clear: both;\" \/>\n<p>More about <a href=\"https:\/\/www.withdata.com\/my-cmd\/\">my-cmd &#8211; Command Line Interface (CLI) tool for MySQL<\/a><\/p>\n<div id=\"download-bottom\" style=\"clear: both;\">\n<p>Download my-cmd Macos version<a href=\"#download-bottom\" onclick=\"dbv.style.display = 'block';\"><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/btn_download_green.png\" alt=\"Download my-cmd\" width=\"165\" height=\"50\" style=\"max-width:100%;height:auto;\" \/><\/a> <span id=\"dbv\" style=\"display: none;\"><br \/>\n<a href=\"\/down\/my-cmd.darwin-amd64.zip\">my-cmd.darwin-amd64.zip<\/a><br \/>\n<a href=\"\/down\/my-cmd.darwin-arm64.zip\">my-cmd.darwin-arm64.zip<\/a><\/p>\n<p><\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Want to import data from TXT file to MySQL via Command Line Interface (CLI) on MacOS? Using my-cmd, a Command Line Interface (CLI) client for MySQL, you can import data from TXT file to MySQL (MariaDB, Percona) easily and fast. Direct Interaction or Scripting and Automation. No need to install MySQL client library. Convenient to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2552],"tags":[73,6,2554,1323,1636,50],"class_list":["post-9647","post","type-post","status-publish","format-standard","hentry","category-my-cmd","tag-command-line","tag-import","tag-macos","tag-mysql","tag-mysql-import-txt","tag-txt"],"_links":{"self":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/9647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/comments?post=9647"}],"version-history":[{"count":6,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/9647\/revisions"}],"predecessor-version":[{"id":39994,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/9647\/revisions\/39994"}],"wp:attachment":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/media?parent=9647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/categories?post=9647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/tags?post=9647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}