我们如何解决 MySQL 错误“ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement”在导入或导出数据时
MySQL抛出此错误的原因有两个,要么在--secure--file--priv变量下未指定目录,要么在导入或导出数据时在查询中提供了错误的路径。要解决此错误,我们必须通过以下查询检查–secure-file-priv变量的值-
mysql> Select @@global.secure_file_priv; +---------------------------+ | @@global.secure_file_priv | +---------------------------+ | C:\mysql\bin\mysql-files\ | +---------------------------+ 1 row in set (0.00 sec)
我们可以看到,secure_file_priv变量下有路径,导出数据时所有的文件都会创建在这个目录下。
但是,如果上面的命令显示NULL作为结果,则表示没有指定路径,我们需要my.ini在导出数据之前指定文件中的路径。假设如果我们将secure_file_priv=mysql-files/写入我们的my.ini文件中,那么secure_file_priv将具有上述路径作为其值。然后所有文件都将在此目录下创建。
热门推荐
1 训练狗狗憋尿
2 狗狗追踪训练
3 狗狗训练要多少钱
5 深圳狗狗训练
6 训练狗狗唤回
7 狗狗叫怎么训练
8 狗狗训练班
10 狗狗社会化训练
11 狗狗叫回训练
12 广州狗狗训练学校
13 狗狗训练躺下
14 狗狗随行训练
15 训练狗狗巡回
16 狗狗要怎么训练
17 狗狗喂食训练
18 训练狗狗躺下