发现导入文件一直出错,显示ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement。
看了网上的很多办法都不成功,后来发现原来是因为在MySQL 5.7.6版本之后,导入文件只能在secure_file_priv指定的文件夹下
所以用show variables like '%secure%';命令显示文件目录

mysql导出数据到外部文件

解决办法修改数据库配置文件

mysql导出数据到外部文件

插入一行代码

secure_file_priv="D:/phpstudy/"

mysql导出数据到外部文件

=号后面的是要导出的路径,可以自己指定,经测试只能将数据导入到该文件夹,其它文件夹无效,子文件也不行

 

相关文章:

  • 2022-01-03
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-12-05
  • 2021-12-06
  • 2021-05-18
猜你喜欢
  • 2021-11-07
  • 2021-06-10
  • 2022-12-23
  • 2021-10-10
  • 2021-05-19
  • 2022-03-01
  • 2021-11-19
相关资源
相似解决方案