我有 4 个 csv 文件要导入到我的 AWS mysql 数据库中。
我正在尝试从 Windows 机器使用以下命令:
"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqlimport.exe" -h myhostname.amazonaws.com -P 3306 -u admin -pmypassword --local --fields-terminated-by=, --lines-terminated-by="\r\n" ticketsdb tickets "Data_2014_1.csv"
Run Code Online (Sandbox Code Playgroud)
我得到的回应是这样的:
mysqlimport: [Warning] Using a password on the command line interface can be insecure.
mysqlimport: Error: 2, File 'tickets' not found (Errcode: 2 - No such file or directory), when using table: tickets
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用mongoimport将cmd中的csv文件导入到MongoDB中。
我的某些csv字段包含单个"double quotes"这样的内容:
Dave, 25, 406-836-3336, "51 Ashleigh St, 20141123
Run Code Online (Sandbox Code Playgroud)
我希望它们要么被忽略,要么作为空字符串导入。我真的不在乎地址字段。我不在乎如何导入它,因为不会对其进行任何操作。
我真正关心的是所有行都将被导入。