mysql导入CSV错误代码: 1290 The MySQL server is running with the --secure-file-priv option so it cannot execute this
错误原因:在安装MySQL的时候限制了导入与导出的目录权限,只能在规定的目录下才能导入
1.进入mysql查看secure_file_prive的值
$mysql -u root -p
mysql>SHOW VARIABLES LIKE "secure_file_priv";
secure_file_prive=null -- 限制mysqld 不允许导入导出
secure_file_priv=/tmp/ -- 限制mysqld的导入导出只能发生在/tmp/目录下
secure_file_priv=' ' -- 不对mysqld 的导入 导出做限制
修改为secure_file_priv=' '
按照以下步骤修改secure_file_priv=' ' -- 不对mysqld 的导入 导出做限制
https://jingyan.baidu.com/article/642c9d342e5a16644b46f74e.html
修改后重启
重启时出现了服务名无效
1.win+R打开运行窗口,输入services.msc
2.在其中查看mysql的服务名,我的是MySQL80
3.以管理员身份打开cmd,输入net start MySQL80