OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Command-Line Client

V2.2.13
  • Introduction
    • Overview of OBClient
  • Quick start
    • Quick start with OBClient
  • Command-line options
    • Common OBClient command-line options
    • Reference for OBClient command-line options
    • SQL context when a script fails
  • Configuration and environment
    • Configure OBClient and set environment variables
  • User guide
    • Reference for OBClient internal commands
  • Advanced features
    • Support for Oracle-compatible mode in OBClient
    • Log in to OBClient through a socket5 proxy
    • Multi-IP connection support for OBClient
    • Client IP passthrough and tenant allowlist (F5 scenario)
    • Log in as a proxy user of OBClient
    • LOAD DATA LOCAL INFILE
    • SET variables
    • Supported login_path options for OBClient
  • Tips and troubleshooting
    • OBClient Usage Tips and Troubleshooting

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Command-Line Client
  3. V2.2.13

LOAD DATA LOCAL INFILE

Last Updated:2026-09-02 09:17:42

Enable the LOCAL INFILE feature
Usage example
References

OBClient supports the LOAD DATA LOCAL INFILE statement, which is used to import data from a local file into a database table.

Enable the LOCAL INFILE feature

Enable the LOCAL INFILE feature by using the --local-infile option:

obclient --local-infile -h127.0.0.1 -P2881 -uroot@sys -p

or specify it explicitly:

obclient --local-infile=1 -h127.0.0.1 -P2881 -uroot@sys -p

Usage example

  1. Prepare the data file dat.txt:

    1,2,3
    4,5,6
    7,8,9
    
  2. Create a table:

    CREATE TABLE test(a INT, b INT, c INT);
    
  3. Execute the LOAD DATA LOCAL INFILE command:

    LOAD DATA LOCAL INFILE '/data/dat.txt' 
    INTO TABLE test 
    FIELDS TERMINATED BY ',' (a, b, c);
    
  4. View the results:

    SELECT * FROM test;
    

    The query result is as follows:

    +---+---+---+
    | a | b | c |
    +---+---+---+
    | 1 | 2 | 3 |
    | 4 | 5 | 6 |
    | 7 | 8 | 9 |
    +---+---+---+
    

References

  • Command-line options reference

Previous topic

Log in as a proxy user of OBClient
Last

Next topic

SET variables
Next
on this page
Enable the LOCAL INFILE feature
Usage example
References