V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
GarboHeart
V2EX  ›  MySQL

请问 Mac 终端加载 csv 文件的 sqI 指令是什么

  •  
  •   GarboHeart · Nov 29, 2018 · 2767 views
    This topic created in 2707 days ago, the information mentioned may be changed or developed.
    win 终端
    load date local infile ‘文件路径’ into table 库名.表名
    fields terminated by ‘,’;

    这个指令可以把 csv 文件加载到某个表中

    Mac 终端
    use 库名;
    source 文件路径;

    只能把数据加载到某个库里 (还没有成功

    Q: 所以想要像 win 一样把数据加载到某个表中,怎么做
    4 replies    2018-11-29 23:20:24 +08:00
    rrfeng
        1
    rrfeng  
       Nov 29, 2018
    跟系统有什么关系??
    aborigine
        2
    aborigine  
       Nov 29, 2018 via iPhone
    source 的是 sql 文件,和 csv 没关系,要是 mac 上不能用 load data infile,改配置文件去
    ysc3839
        3
    ysc3839  
       Nov 29, 2018
    终端只会显示文字,不会进行处理。你说的应该是某个数据库的 shell,这是什么数据库呢?
    ysc3839
        4
    ysc3839  
       Nov 29, 2018
    @ysc3839 抱歉,没看清是 MySQL ……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5147 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 09:45 · PVG 17:45 · LAX 02:45 · JFK 05:45
    ♥ Do have faith in what you're doing.