2023-07-24 mysql-load加载数据-记录

摘要:

2023-07-24 mysql-load加载数据-记录

数据文件准备:

region表结构:

CREATE TABLE region  ( R_REGIONKEY  INTEGER NOT NULL,
                            R_NAME       CHAR(25) NOT NULL,
                            R_COMMENT    VARCHAR(152));

region.tbl表文件内容

0|AFRICA|lar deposits. blithely final packages cajole. regular waters are final requests. regular accounts are according to |
1|AMERICA|hs use ironic, even requests. s|
2|ASIA|ges. thinly even pinto beans ca|
3|EUROPE|ly final courts cajole furiously final excuse|
4|MIDDLE EAST|uickly special accounts cajole carefully blithely close requests. carefully final asymptotes haggle furiousl|

mysql配置及登录参数

my.cnf配置

[client]
#password	= your_password
port		= 3306
socket		= /tmp/mysql.sock
local_infile=ON

[mysqld]
port		= 3306
socket		= /tmp/mysql.sock
slow_query_log = ON
log-error   = /var/log/mysql/mysqld.log
local_infile=ON
secure_file_priv=''
debug='d,mdb'

skip-grant-tables

mysql客户端登录参数

mysql -ubisal -pbisal --local-infile=1

mysql客户端load数据

load data local infile '/tmp/region.tbl' into table region fields terminated by '|';

参考:

MySQL :: MySQL 8.0 Reference Manual :: 13.2.9 LOAD DATA Statement

你可能感兴趣的:(mysql内核源码分析,mysql,数据库)