Skip to content
#

life

Here are 467 public repositories matching this topic...

mrdulin
mrdulin commented May 25, 2019

PostgreSQL使用COPY命令复制CSV文件数据报错

前言

阅读此文章需要熟练掌握以下技术:

  • PostgreSQL 9.6
  • Knex.js - SQL查询构建器
  • Docker/Docker compose - 容器/容器编排
  • Node.js
  • TypeScript
  • SQL - 结构化查询语言
  • Google Adwords (Optional)

需求

下载Google Adwords Geo Targets CSV file到文件系统,通过Knex.js这个SQL query builder提供的database migration命令行工具,将CSV file中的数据通过PostgreSQL提供的COPY命令复制到预先创建好的数据库表中。

问题

问题出现都是有上下文的,

sunmaobin
sunmaobin commented Nov 28, 2018

一、修改MySQL的配置文件

MySQL的配置文件 my.cnf ,所在位置一般在:/etc/my.cnf,如果不在这个目录下,可以搜索下:whereis my.cnf

修改每个对应项为 utf8mb4 编码:

[client]
default-character-set=utf8mb4
 
[mysql]
default-character-set=utf8mb4
 
[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect = 'SET NAMES utf8mb4'
character-set-client-handshake = false

修改完成后,重启MySQL,然后查看配置

taxonworks
mjy
mjy commented Sep 29, 2019

Overview

Everything in lib/utilities is intended to be Rails agnostic (though many use some feature like .blank?. These libraries are execellent targets for extraction and simplification of our code base.

Extraction target

Re-integration

Refactoring should be s

Improve this page

Add a description, image, and links to the life topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the life topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.