MARIADB-IMPORT(1)
π mariadb-import β like, the data import program, bestie
okay so real quick, this page lives in the MariaDB Database System manual β it's mariadb-import(1) and it's about to be your new fave. also lol, tiny detail: mariadb-import is now a symlink to mariadb-import (yes fr, that's what it says, iconic circular king behavior π).
β¨ NAME β¨
mariadb-import β a data import program (mariadb-import is now a symlink to mariadb-import)
πΈ SYNOPSIS πΈ
mariadb-import [options] db_name textfile1 ...
π¦ DESCRIPTION π¦
So mariadb-import is this client that gives you a command-line interface to the LOAD DATA INFILE SQL statement. Most options on mariadb-import correspond directly to clauses of LOAD DATA INFILE syntax. it's giving "what if LOAD DATA INFILE but make it a vibe." π
You invoke it like this:
shell> mariadb-import [options] db_name textfile1 [textfile2 ...]
For each text file you name on the command line, mariadb-import strips any extension from the file name and uses the result to determine the name of the table into which to import the file's contents. Like, files named patient.txt, patient.text, and patient would all be imported into a table named patient. no cap, the extension is just decoration to it π
mariadb-import supports the following options, which can be specified on the command line or in the [mariadb-import] and [client] option file groups. mariadb-import also supports the options for processing option files. (iykyk π«Ά)
π OPTIONS π
--help,-?β Display a help message and exit. your little cry for help is heard, bestie π«Ά--character-sets-dir=pathβ The directory where character sets are installed.--columns=column_list,-c column_listβ This option takes a comma-separated list of column names as its value. The order of the column names indicates how to match data file columns with table columns. order matters, always does π--compress,-Cβ Compress all information sent between the client and the server if both support compression. teamwork makes the dream work β¨--debug[=debug_options],-# [debug_options]β Write a debugging log. A typicaldebug_optionsstring is'd:t:o,file_name'. The default is'd:t:o'.--debug-checkβ Print some debugging information when the program exits.--debug-infoβ Print debugging information and memory and CPU usage statistics when the program exits. stats girlies rise π--default-auth=plugin_nameβ Default authentication client-side plugin to use.--default-character-set=charset_nameβ Usecharset_nameas the default character set.--defaults-extra-file=filenameβ Setfilenameas the file to read default options from after the global defaults files has been read. Must be given as first option. first. option. no exceptions π€--defaults-file=filenameβ Setfilenameas the file to read default options from, override global defaults files. Must be given as first option.--delete,-dβ Empty the table before importing the text file. out with the old, in with the new π--fields-terminated-by=...,--fields-enclosed-by=...,--fields-optionally-enclosed-by=...,--fields-escaped-by=...β These options have the same meaning as the corresponding clauses forLOAD DATA INFILE.--force,-fβ Ignore errors. For example, if a table for a text file does not exist, continue processing any remaining files. Without--force,mariadb-importexits if a table does not exist. living dangerously, but make it resilient π₯--host=host_name,-h host_nameβ Import data to the MariaDB server on the given host. The default host islocalhost.--ignore,-iβ See the description for the--replaceoption. (scroll a bit, bestie π)--ignore-foreign-keys,-kβ Disable foreign key checks while importing the data.--ignore-lines=Nβ Ignore the firstNlines of the data file.--innodb-optimize-keysβ Create secondary indexes after data load, which speeds up loading (InnoDB only). Defaults to on; use--skip-innodb-optimize-keysto disable. obsessively efficient, we stan β--lines-terminated-by=...β This option has the same meaning as the corresponding clause forLOAD DATA INFILE. For example, to import Windows files that have lines terminated with carriage return/linefeed pairs, use--lines-terminated-by="\r\n". (You might have to double the backslashes, depending on the escaping conventions of your command interpreter.). yes the double-backslash thing is real, ask your shell π--local,-Lβ Read input files locally from the client host.--lock-tables,-lβ Lock all tables for writing before processing any text files. This ensures that all tables are synchronized on the server.--low-priorityβ UseLOW_PRIORITYwhen loading the table. This affects only storage engines that use only table-level locking (such as MyISAM, MEMORY, and MERGE).--no-defaultsβ Do not read default options from any option file. This must be given as the first argument.--parallel=N,-j Nβ Number ofLOAD DATAjobs executed in parallel.--use-threadsis a synonym. multitasking queen π§--password[=password],-p[password]β The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the--passwordor-poption on the command line,mariadb-importprompts for one.
Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line.
β οΈ seriously, password on the command line = insecure. use an option file, protect your peace π
--pipe,-Wβ On Windows, connect to the server via a named pipe. This option applies only if the server supports named-pipe connections.--plugin-dir=nameβ Directory for client-side plugins.--port=port_num,-P port_numβ The TCP/IP port number to use for the connection. Forces--protocol=tcpwhen specified on the command line without other connection properties.--protocol={TCP|SOCKET|PIPE|MEMORY}β The connection protocol to use for connecting to the server. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. main character energy: you pick, not the defaults π--print-defaultsβ Print the program argument list and exit. This must be given as the first argument.--replace,-rβ The--replaceand--ignoreoptions control handling of input rows that duplicate existing rows on unique key values. If you specify--replace, new rows replace existing rows that have the same unique key value. If you specify--ignore, input rows that duplicate an existing row on a unique key value are skipped. If you do not specify either option, an error occurs when a duplicate key value is found, and the rest of the text file is ignored. choose your fighter, but choose one π--silent,-sβ Silent mode. Produce output only when errors occur.--socket=path,-S pathβ For connections tolocalhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. Forces--protocol=socketwhen specified on the command line without other connection properties; on Windows, forces--protocol=pipe.--sslβ Enable SSL for connection (automatically enabled with other flags). Disable with--skip-ssl. secure the bag π₯--ssl-ca=nameβ CA file in PEM format (check OpenSSL docs, implies--ssl).--ssl-capath=nameβ CA directory (check OpenSSL docs, implies--ssl).--ssl-cert=nameβ X509 cert in PEM format (check OpenSSL docs, implies--ssl).--ssl-cipher=nameβ SSL cipher to use (check OpenSSL docs, implies--ssl).--ssl-key=nameβ X509 key in PEM format (check OpenSSL docs, implies--ssl).--ssl-crl=nameβ Certificate revocation list (check OpenSSL docs, implies--ssl).--ssl-crlpath=nameβ Certificate revocation list path (check OpenSSL docs, implies--ssl).--ssl-verify-server-certβ Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default.--user=user_name,-u user_nameβ The MariaDB user name to use when connecting to the server.--use-threads=Nβ Load files in parallel usingNthreads. Synonym for-j,--parallel=num.--verbose,-vβ Verbose mode. Print more information about what the program does. tell me everything π£οΈ--version,-Vβ Display version information and exit.
π sample session (a whole little story, honestly) π
Here is a sample session that demonstrates use of mariadb-import:
shell> mariadb -e 'CREATE TABLE imptest(id INT, n VARCHAR(30))' test
shell> ed
a
100 Max Sydow
101 Count Dracula
.
w imptest.txt
32
q
shell> od -c imptest.txt
0000000 1 0 0 \t M a x S y d o w \n 1 0
0000020 1 \t C o u n t D r a c u l a \n
0000040
shell> mariadb-import --local test imptest.txt
test.imptest: Records: 2 Deleted: 0 Skipped: 0 Warnings: 0
shell> mariadb -e 'SELECT * FROM imptest' test
+------+---------------+
| id | n |
+------+---------------+
| 100 | Max Sydow |
| 101 | Count Dracula |
+------+---------------+
like, look at Count Dracula just sitting there in a table. ate. πβ¨
π COPYRIGHT π
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2025 MariaDB Foundation
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/.
π SEE ALSO π
For more information, please refer to the MariaDB Documentation, available online at https://mariadb.com/docs/ β go read it, it's giving homework but the fun kind π
π«Ά AUTHOR π«Ά
MariaDB Foundation (http://www.mariadb.org/).
and that's the whole page, bestie!! π¦ mwah π β this lil rewrite is brought to you by MariaDB 11.8, dated 10 February 2025, and the manual page MARIADB-IMPORT(1). now go import something iconic πβ¨
π¦ where this page comes from
- alpine 3.24: mariadb-doc 11.8.9-r0 Β· GPL-2.0-only
- centos-stream 10: mariadb11.8 3:11.8.8-1.el10 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- centos-stream 9: mariadb 3:11.8.8-1.module_el9+1370+ec5ecc2e Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- debian trixie: mariadb-client 1:11.8.6-0+deb13u1 Β· GPL-2.0-only
- fedora 43: mariadb11.8 3:11.8.8-1.fc43 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- fedora 44: mariadb 3:11.8.6-2.fc44 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- fedora 44: mariadb 3:11.8.8-3.fc44 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- nixpkgs unstable: mariadb-server 11.8.8
- opensuse-leap 16.0: mariadb-client 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- opensuse-leap 16.0: mariadb-client 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- opensuse-leap 16.0: mariadb-client 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- opensuse-leap 16.0: mariadb-client 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- ubuntu resolute: mariadb-client 1:11.8.6-5 Β· GPL-2.0-only
- ubuntu resolute: mariadb-client 1:11.8.6-5ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: mariadb-client 1:11.8.9+ds-4ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms