MySQL批量加载命令行工具 [英] MySql bulk load command line tool

查看:78
本文介绍了MySQL批量加载命令行工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MySql是否具有大容量加载命令行工具,例如用于SQLServer的bcp和用于Oracle的sqlldr?我知道有一个SQL命令LOAD INFILE或类似的命令,但是有时我需要将与MySQL数据库不同的文件批量加载.

Does MySql have a bulk load command line tool like bcp for SQLServer and sqlldr for Oracle? I know there's a SQL command LOAD INFILE or similar but I sometimes need to bulk load a file that is on a different box to the MySQL database.

推荐答案

mysqlimport.

mysqlimport.

采用与mysql命令行外壳相同的连接参数.确保使用-L标志在本地文件系统上使用文件,否则(奇怪地)将假定该文件在服务器上.

takes the same connection parameters as the mysql command line shell. Make sure to use the -L flag to use a file on the local file system, otherwise it will (strangely) assume the file is on the server.

load data infile命令也有一个类似的变体,即load data local infile,根据该变体,将从客户端而不是从服务器加载文件,这可以完成您想做的事情.

There is also an analogous variant to the load data infile command, i.e., load data local infile, according to which the file will be loaded from the client rather than the server, which may accomplish what you want to do.

这篇关于MySQL批量加载命令行工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆