OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.2.5

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & CertificationTicket
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.2.5
    iconOceanBase Database
    SQL - V 4.2.5
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    secure_file_priv

    Last Updated:2026-04-27 03:14:13  Updated
    share
    What is on this page
    Description
    Privilege requirements
    Attributes
    Usage
    Examples
    References

    folded

    share

    Note

    This variable is available starting with V2.2.77.

    Description

    secure_file_priv specifies the accessible path for importing or exporting data to or from a file.

    Note

    The log/alert directory is in the allowlist of the system tenant. You can skip checking the secure_file_priv variable when accessing this directory.

    Notice

    Due to security reasons, only a client that connects to OceanBase Database through a local Unix socket can execute an SQL statement to modify this global variable.

    Privilege requirements

    • Query variables

      The sys tenant and all user tenants can execute the SHOW VARIABLES statement or query the SYS.TENANT_VIRTUAL_GLOBAL_VARIABLE view (Oracle mode) or the information_schema.GLOBAL_VARIABLES view (MySQL mode) to view the value of a global system variable.

    • Modify variables

      • Global level

        • The sys tenant can directly modify the value of a global system variable.

        • A MySQL user tenant must have the SUPER or ALTER SYSTEM privilege to modify the value of a global system variable.

        • An Oracle user tenant must have the ALTER SYSTEM privilege to modify the value of a global system variable.

    Attributes

    Attribute
    Description
    Type Varchar
    Default value "" indicates an empty string.

    Note

    Starting from V4.2.1, the default value is changed from NULL to "".

    Value range
    • An empty string: indicates that importing and exporting are disabled.
    • NULL: indicates that importing and exporting are disabled.
    • "NULL": indicates that importing and exporting are disabled.
    • A path name: indicates that only files in the specified path can be imported or exported.
    • "/": indicates that no restrictions are imposed, and any path can be accessed.

    Note

    Starting from V4.2.0, the values empty string and NULL indicate that importing and exporting are disabled, instead of no restrictions.

    Scope Global
    Modifiable Yes. You can execute the SET statement to modify the value.
    Nullable Yes

    Usage

    You can connect to OceanBase Database only through a local Unix socket.

    obclient -S /home/admin/oceanbase/run/sql.sock -u******@obtenant -p******
    

    If the current user is not the same as the user that started the OBServer node, the current user does not have the sql.sock file. You can run the following command to connect to OceanBase Database.

    sudo -u <user of observer> obclient -S /home/admin/oceanbase/run/sql.sock -u******@obtenant -p******
    

    The parameters are described as follows:

    • -S: specifies the path of the Unix socket file of the local OBServer node. The Unix socket file is located in the installation directory of the local OBServer node, and the default path is /home/admin/oceanbase/run/sql.sock.
    • -u: specifies the tenant account. The format is username@tenant name.

    When you connect to OceanBase Database through a Unix socket, you can only connect to the local OBServer node. You must also ensure that the resources of the tenant are distributed on the local OBServer node. If the resources of the tenant are not distributed on the local OBServer node, you cannot connect to the tenant through the local OBServer node.

    Examples

    Set the accessible path for importing or exporting data to or from a file to "".

    obclient> SET GLOBAL secure_file_priv = "";
    

    References

    • Manage directories
    • Set the path for direct load
    • Specify the file path for an external table

    Previous topic

    resource_manager_plan
    Last

    Next topic

    socket
    Next
    What is on this page
    Description
    Privilege requirements
    Attributes
    Usage
    Examples
    References