【问题标题】:MySQL Error Code: 3948 Loading local data is disabled; this must be enabled on both the client and server sidesMySQL 错误代码:3948 加载本地数据已禁用;这必须在客户端和服务器端都启用
【发布时间】:2021-03-29 03:51:54
【问题描述】:

我有这段代码可以将 CSV 文件上传到 MySQL,我尝试上传我创建的 CSV 文件,但在运行代码时不断收到此错误。

我要运行的代码在这里:

Load Data Local Infile

'/Users/dylanpowell/Dropbox/Dylan Powell/Berkeley Investment Advisors/Dylans Stock Evaluations/Bottom Scores at 9-7-19.csv'

Into Table Stock_Evaluator_Raw_Scores 
    Fields Terminated by ','

    Enclosed by '"'

    Escaped by '\\'

    Lines terminated by '\n'
 Ignore 1 Lines; 

错误如下:

Error Code: 3948. Loading local data is disabled; this must be enabled on both the client and server side. Load Data Local Infile '/Users/dylanpowell/Dropbox/Dylan Powell/Berkeley Investment Advisors/Dylans Stock Evaluations/Bottom Scores at 9-7-19.csv'Into Table Stock_Evaluator_Raw_Scores Fields Terminated by ','Enclosed by '"' Escaped by '\\'Lines terminated by '\n' Ignore 1 Lines; 

我注意到这个问题还有另一个堆栈溢出,但我不确定如何实现这些方法来让我的代码运行。

【问题讨论】:

    标签: mysql sqlhelper


    【解决方案1】:
    1. 打开 MYSQL 命令行

    2. 输入你的密码

    3. 输入以下内容:

      显示像“local_infile”这样的全局变量;

    4. 如果 local_infile 的值等于 false,则将其设置为 true:

      SET GLOBAL local_infile = true;

    更多信息在这里:https://www.digitalocean.com/community/questions/how-to-enable-local-capability-in-mysql-workbench

    【讨论】:

      猜你喜欢
      • 2020-05-31
      • 2017-08-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-17
      • 1970-01-01
      相关资源
      最近更新 更多