Overview
secure_file_priv controls the paths that can be accessed when importing or exporting to files.
Note
The log/alert directory is in the allowlist of file access privileges for the system tenant. This directory can be skipped when checking the secure_file_priv privilege.
Notice
For security reasons, only a client connected via a local Unix socket can execute SQL statements that modify this global variable.
Privilege requirements
Query variables
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement and theinformation_schema.GLOBAL_VARIABLESview to view the values of global system variables.Modify variables
Global effective
The
systenant can directly modify the values of global system variables.The user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Varchar |
| Default Value | "" indicates an empty string. |
| Value range |
|
| Effective Scope | Global |
| Modifiable | Yes, you can use theSETStatement modification. |
| Nullable | Yes |
Usage instructions
Only local Unix socket connections are supported for connecting to OceanBase AI Database.
obclient -S /home/admin/oceanbase/run/sql.sock -u******@obtenant -p******
If the current user is different from the user who started the OBServer, the current user does not have permission on sql.sock. You need to connect using the following command.
sudo -u <user of observer> obclient -S /home/admin/oceanbase/run/sql.sock -u******@obtenant -p******
The parameters are described as follows:
- -S: The path to the Unix domain socket file of the local OBServer node, which is located in the run directory under the local OBServer installation directory. The default Unix domain socket file path is
/home/admin/oceanbase/run/sql.sock. - -u: the connection account for the tenant, in the format
username@tenant_name.
When connecting via a Unix socket, you can only connect to a local OBServer node. You must also ensure that the tenant's resources are distributed on the local OBServer node. If the tenant's resources are not distributed on the local OBServer node, you cannot connect to the tenant through the local OBServer node.
Configuration example
Set the accessible path for importing or exporting to a file as "".
obclient> SET GLOBAL secure_file_priv = "";